From 800b35f59880799173b97cd764b1bb672be4fc42 Mon Sep 17 00:00:00 2001 From: Andrew Boie Date: Tue, 5 Nov 2019 09:27:18 -0800 Subject: [PATCH] kernel: use uintptr_t for syscall arguments We need to pass system call args using a register-width data type and not hard-code this to u32_t. Signed-off-by: Andrew Boie --- doc/reference/usermode/syscalls.rst | 2 +- include/arch/arc/syscall.h | 30 ++++++++++++++---------- include/arch/arm/syscall.h | 31 +++++++++++++++---------- include/arch/x86/ia32/syscall.h | 31 +++++++++++++++---------- include/sys/arch_inlines.h | 33 +++++++++++++++----------- include/syscall.h | 7 +++--- kernel/userspace.c | 14 +++++++---- scripts/gen_syscalls.py | 36 ++++++++++++++--------------- 8 files changed, 107 insertions(+), 77 deletions(-) diff --git a/doc/reference/usermode/syscalls.rst b/doc/reference/usermode/syscalls.rst index b59dce3e3ca..0ae042ae27a 100644 --- a/doc/reference/usermode/syscalls.rst +++ b/doc/reference/usermode/syscalls.rst @@ -149,7 +149,7 @@ Inside this header is the body of :c:func:`k_sem_init()`:: { #ifdef CONFIG_USERSPACE if (z_syscall_trap()) { - z_arch_syscall_invoke3(*(u32_t *)&sem, *(u32_t *)&initial_count, *(u32_t *)&limit, K_SYSCALL_K_SEM_INIT); + z_arch_syscall_invoke3(*(uintptr_t *)&sem, *(uintptr_t *)&initial_count, *(uintptr_t *)&limit, K_SYSCALL_K_SEM_INIT); return; } compiler_barrier(); diff --git a/include/arch/arc/syscall.h b/include/arch/arc/syscall.h index 751ded8b49a..a3b7cf28e0b 100644 --- a/include/arch/arc/syscall.h +++ b/include/arch/arc/syscall.h @@ -38,9 +38,10 @@ extern "C" { * just for enabling CONFIG_USERSPACE on arc w/o errors. */ -static inline u32_t z_arch_syscall_invoke6(u32_t arg1, u32_t arg2, u32_t arg3, - u32_t arg4, u32_t arg5, u32_t arg6, - u32_t call_id) +static inline uintptr_t z_arch_syscall_invoke6(uintptr_t arg1, uintptr_t arg2, + uintptr_t arg3, uintptr_t arg4, + uintptr_t arg5, uintptr_t arg6, + uintptr_t call_id) { register u32_t ret __asm__("r0") = arg1; register u32_t r1 __asm__("r1") = arg2; @@ -62,8 +63,10 @@ static inline u32_t z_arch_syscall_invoke6(u32_t arg1, u32_t arg2, u32_t arg3, return ret; } -static inline u32_t z_arch_syscall_invoke5(u32_t arg1, u32_t arg2, u32_t arg3, - u32_t arg4, u32_t arg5, u32_t call_id) +static inline uintptr_t z_arch_syscall_invoke5(uintptr_t arg1, uintptr_t arg2, + uintptr_t arg3, uintptr_t arg4, + uintptr_t arg5, + uintptr_t call_id) { register u32_t ret __asm__("r0") = arg1; register u32_t r1 __asm__("r1") = arg2; @@ -84,8 +87,9 @@ static inline u32_t z_arch_syscall_invoke5(u32_t arg1, u32_t arg2, u32_t arg3, return ret; } -static inline u32_t z_arch_syscall_invoke4(u32_t arg1, u32_t arg2, u32_t arg3, - u32_t arg4, u32_t call_id) +static inline uintptr_t z_arch_syscall_invoke4(uintptr_t arg1, uintptr_t arg2, + uintptr_t arg3, uintptr_t arg4, + uintptr_t call_id) { register u32_t ret __asm__("r0") = arg1; register u32_t r1 __asm__("r1") = arg2; @@ -105,8 +109,9 @@ static inline u32_t z_arch_syscall_invoke4(u32_t arg1, u32_t arg2, u32_t arg3, return ret; } -static inline u32_t z_arch_syscall_invoke3(u32_t arg1, u32_t arg2, u32_t arg3, - u32_t call_id) +static inline uintptr_t z_arch_syscall_invoke3(uintptr_t arg1, uintptr_t arg2, + uintptr_t arg3, + uintptr_t call_id) { register u32_t ret __asm__("r0") = arg1; register u32_t r1 __asm__("r1") = arg2; @@ -124,7 +129,8 @@ static inline u32_t z_arch_syscall_invoke3(u32_t arg1, u32_t arg2, u32_t arg3, return ret; } -static inline u32_t z_arch_syscall_invoke2(u32_t arg1, u32_t arg2, u32_t call_id) +static inline uintptr_t z_arch_syscall_invoke2(uintptr_t arg1, uintptr_t arg2, + uintptr_t call_id) { register u32_t ret __asm__("r0") = arg1; register u32_t r1 __asm__("r1") = arg2; @@ -141,7 +147,7 @@ static inline u32_t z_arch_syscall_invoke2(u32_t arg1, u32_t arg2, u32_t call_id return ret; } -static inline u32_t z_arch_syscall_invoke1(u32_t arg1, u32_t call_id) +static inline uintptr_t z_arch_syscall_invoke1(uintptr_t arg1, uintptr_t call_id) { register u32_t ret __asm__("r0") = arg1; register u32_t r6 __asm__("r6") = call_id; @@ -157,7 +163,7 @@ static inline u32_t z_arch_syscall_invoke1(u32_t arg1, u32_t call_id) return ret; } -static inline u32_t z_arch_syscall_invoke0(u32_t call_id) +static inline uintptr_t z_arch_syscall_invoke0(uintptr_t call_id) { register u32_t ret __asm__("r0"); register u32_t r6 __asm__("r6") = call_id; diff --git a/include/arch/arm/syscall.h b/include/arch/arm/syscall.h index 9ebbd202df6..f727fff2b99 100644 --- a/include/arch/arm/syscall.h +++ b/include/arch/arm/syscall.h @@ -36,9 +36,10 @@ extern "C" { /* Syscall invocation macros. arm-specific machine constraints used to ensure * args land in the proper registers. */ -static inline u32_t z_arch_syscall_invoke6(u32_t arg1, u32_t arg2, u32_t arg3, - u32_t arg4, u32_t arg5, u32_t arg6, - u32_t call_id) +static inline uintptr_t z_arch_syscall_invoke6(uintptr_t arg1, uintptr_t arg2, + uintptr_t arg3, uintptr_t arg4, + uintptr_t arg5, uintptr_t arg6, + uintptr_t call_id) { register u32_t ret __asm__("r0") = arg1; register u32_t r1 __asm__("r1") = arg2; @@ -58,8 +59,10 @@ static inline u32_t z_arch_syscall_invoke6(u32_t arg1, u32_t arg2, u32_t arg3, return ret; } -static inline u32_t z_arch_syscall_invoke5(u32_t arg1, u32_t arg2, u32_t arg3, - u32_t arg4, u32_t arg5, u32_t call_id) +static inline uintptr_t z_arch_syscall_invoke5(uintptr_t arg1, uintptr_t arg2, + uintptr_t arg3, uintptr_t arg4, + uintptr_t arg5, + uintptr_t call_id) { register u32_t ret __asm__("r0") = arg1; register u32_t r1 __asm__("r1") = arg2; @@ -78,8 +81,9 @@ static inline u32_t z_arch_syscall_invoke5(u32_t arg1, u32_t arg2, u32_t arg3, return ret; } -static inline u32_t z_arch_syscall_invoke4(u32_t arg1, u32_t arg2, u32_t arg3, - u32_t arg4, u32_t call_id) +static inline uintptr_t z_arch_syscall_invoke4(uintptr_t arg1, uintptr_t arg2, + uintptr_t arg3, uintptr_t arg4, + uintptr_t call_id) { register u32_t ret __asm__("r0") = arg1; register u32_t r1 __asm__("r1") = arg2; @@ -97,8 +101,9 @@ static inline u32_t z_arch_syscall_invoke4(u32_t arg1, u32_t arg2, u32_t arg3, return ret; } -static inline u32_t z_arch_syscall_invoke3(u32_t arg1, u32_t arg2, u32_t arg3, - u32_t call_id) +static inline uintptr_t z_arch_syscall_invoke3(uintptr_t arg1, uintptr_t arg2, + uintptr_t arg3, + uintptr_t call_id) { register u32_t ret __asm__("r0") = arg1; register u32_t r1 __asm__("r1") = arg2; @@ -114,7 +119,8 @@ static inline u32_t z_arch_syscall_invoke3(u32_t arg1, u32_t arg2, u32_t arg3, return ret; } -static inline u32_t z_arch_syscall_invoke2(u32_t arg1, u32_t arg2, u32_t call_id) +static inline uintptr_t z_arch_syscall_invoke2(uintptr_t arg1, uintptr_t arg2, + uintptr_t call_id) { register u32_t ret __asm__("r0") = arg1; register u32_t r1 __asm__("r1") = arg2; @@ -129,7 +135,8 @@ static inline u32_t z_arch_syscall_invoke2(u32_t arg1, u32_t arg2, u32_t call_id return ret; } -static inline u32_t z_arch_syscall_invoke1(u32_t arg1, u32_t call_id) +static inline uintptr_t z_arch_syscall_invoke1(uintptr_t arg1, + uintptr_t call_id) { register u32_t ret __asm__("r0") = arg1; register u32_t r6 __asm__("r6") = call_id; @@ -142,7 +149,7 @@ static inline u32_t z_arch_syscall_invoke1(u32_t arg1, u32_t call_id) return ret; } -static inline u32_t z_arch_syscall_invoke0(u32_t call_id) +static inline uintptr_t z_arch_syscall_invoke0(uintptr_t call_id) { register u32_t ret __asm__("r0"); register u32_t r6 __asm__("r6") = call_id; diff --git a/include/arch/x86/ia32/syscall.h b/include/arch/x86/ia32/syscall.h index 81d56c416c1..6ed00a59597 100644 --- a/include/arch/x86/ia32/syscall.h +++ b/include/arch/x86/ia32/syscall.h @@ -34,9 +34,10 @@ extern "C" { * z_x86_syscall_entry_stub in userspace.S */ -static inline u32_t z_arch_syscall_invoke6(u32_t arg1, u32_t arg2, u32_t arg3, - u32_t arg4, u32_t arg5, u32_t arg6, - u32_t call_id) +static inline uintptr_t z_arch_syscall_invoke6(uintptr_t arg1, uintptr_t arg2, + uintptr_t arg3, uintptr_t arg4, + uintptr_t arg5, uintptr_t arg6, + uintptr_t call_id) { u32_t ret; @@ -52,8 +53,10 @@ static inline u32_t z_arch_syscall_invoke6(u32_t arg1, u32_t arg2, u32_t arg3, return ret; } -static inline u32_t z_arch_syscall_invoke5(u32_t arg1, u32_t arg2, u32_t arg3, - u32_t arg4, u32_t arg5, u32_t call_id) +static inline uintptr_t z_arch_syscall_invoke5(uintptr_t arg1, uintptr_t arg2, + uintptr_t arg3, uintptr_t arg4, + uintptr_t arg5, + uintptr_t call_id) { u32_t ret; @@ -65,8 +68,9 @@ static inline u32_t z_arch_syscall_invoke5(u32_t arg1, u32_t arg2, u32_t arg3, return ret; } -static inline u32_t z_arch_syscall_invoke4(u32_t arg1, u32_t arg2, u32_t arg3, - u32_t arg4, u32_t call_id) +static inline uintptr_t z_arch_syscall_invoke4(uintptr_t arg1, uintptr_t arg2, + uintptr_t arg3, uintptr_t arg4, + uintptr_t call_id) { u32_t ret; @@ -78,8 +82,9 @@ static inline u32_t z_arch_syscall_invoke4(u32_t arg1, u32_t arg2, u32_t arg3, return ret; } -static inline u32_t z_arch_syscall_invoke3(u32_t arg1, u32_t arg2, u32_t arg3, - u32_t call_id) +static inline uintptr_t z_arch_syscall_invoke3(uintptr_t arg1, uintptr_t arg2, + uintptr_t arg3, + uintptr_t call_id) { u32_t ret; @@ -90,7 +95,8 @@ static inline u32_t z_arch_syscall_invoke3(u32_t arg1, u32_t arg2, u32_t arg3, return ret; } -static inline u32_t z_arch_syscall_invoke2(u32_t arg1, u32_t arg2, u32_t call_id) +static inline uintptr_t z_arch_syscall_invoke2(uintptr_t arg1, uintptr_t arg2, + uintptr_t call_id) { u32_t ret; @@ -102,7 +108,8 @@ static inline u32_t z_arch_syscall_invoke2(u32_t arg1, u32_t arg2, u32_t call_id return ret; } -static inline u32_t z_arch_syscall_invoke1(u32_t arg1, u32_t call_id) +static inline uintptr_t z_arch_syscall_invoke1(uintptr_t arg1, + uintptr_t call_id) { u32_t ret; @@ -114,7 +121,7 @@ static inline u32_t z_arch_syscall_invoke1(u32_t arg1, u32_t call_id) return ret; } -static inline u32_t z_arch_syscall_invoke0(u32_t call_id) +static inline uintptr_t z_arch_syscall_invoke0(uintptr_t call_id) { u32_t ret; diff --git a/include/sys/arch_inlines.h b/include/sys/arch_inlines.h index 824c35812d5..6e04fad03fe 100644 --- a/include/sys/arch_inlines.h +++ b/include/sys/arch_inlines.h @@ -350,7 +350,7 @@ void z_arch_irq_offload(irq_offload_routine_t routine, void *parameter); * @param call_id System call ID * @return Return value of the system call. Void system calls return 0 here. */ -static inline u32_t z_arch_syscall_invoke0(u32_t call_id); +static inline uintptr_t z_arch_syscall_invoke0(uintptr_t call_id); /** * Invoke a system call with 1 argument. @@ -362,7 +362,8 @@ static inline u32_t z_arch_syscall_invoke0(u32_t call_id); * kernel-side dispatch table * @return Return value of the system call. Void system calls return 0 here. */ -static inline u32_t z_arch_syscall_invoke1(u32_t arg1, u32_t call_id); +static inline uintptr_t z_arch_syscall_invoke1(uintptr_t arg1, + uintptr_t call_id); /** * Invoke a system call with 2 arguments. @@ -375,8 +376,8 @@ static inline u32_t z_arch_syscall_invoke1(u32_t arg1, u32_t call_id); * kernel-side dispatch table * @return Return value of the system call. Void system calls return 0 here. */ -static inline u32_t z_arch_syscall_invoke2(u32_t arg1, u32_t arg2, - u32_t call_id); +static inline uintptr_t z_arch_syscall_invoke2(uintptr_t arg1, uintptr_t arg2, + uintptr_t call_id); /** * Invoke a system call with 3 arguments. @@ -390,8 +391,9 @@ static inline u32_t z_arch_syscall_invoke2(u32_t arg1, u32_t arg2, * kernel-side dispatch table * @return Return value of the system call. Void system calls return 0 here. */ -static inline u32_t z_arch_syscall_invoke3(u32_t arg1, u32_t arg2, u32_t arg3, - u32_t call_id); +static inline uintptr_t z_arch_syscall_invoke3(uintptr_t arg1, uintptr_t arg2, + uintptr_t arg3, + uintptr_t call_id); /** * Invoke a system call with 4 arguments. @@ -406,8 +408,9 @@ static inline u32_t z_arch_syscall_invoke3(u32_t arg1, u32_t arg2, u32_t arg3, * kernel-side dispatch table * @return Return value of the system call. Void system calls return 0 here. */ -static inline u32_t z_arch_syscall_invoke4(u32_t arg1, u32_t arg2, u32_t arg3, - u32_t arg4, u32_t call_id); +static inline uintptr_t z_arch_syscall_invoke4(uintptr_t arg1, uintptr_t arg2, + uintptr_t arg3, uintptr_t arg4, + uintptr_t call_id); /** * Invoke a system call with 5 arguments. @@ -423,9 +426,10 @@ static inline u32_t z_arch_syscall_invoke4(u32_t arg1, u32_t arg2, u32_t arg3, * kernel-side dispatch table * @return Return value of the system call. Void system calls return 0 here. */ -static inline u32_t z_arch_syscall_invoke5(u32_t arg1, u32_t arg2, u32_t arg3, - u32_t arg4, u32_t arg5, - u32_t call_id); +static inline uintptr_t z_arch_syscall_invoke5(uintptr_t arg1, uintptr_t arg2, + uintptr_t arg3, uintptr_t arg4, + uintptr_t arg5, + uintptr_t call_id); /** * Invoke a system call with 6 arguments. @@ -442,9 +446,10 @@ static inline u32_t z_arch_syscall_invoke5(u32_t arg1, u32_t arg2, u32_t arg3, * kernel-side dispatch table * @return Return value of the system call. Void system calls return 0 here. */ -static inline u32_t z_arch_syscall_invoke6(u32_t arg1, u32_t arg2, u32_t arg3, - u32_t arg4, u32_t arg5, u32_t arg6, - u32_t call_id); +static inline uintptr_t z_arch_syscall_invoke6(uintptr_t arg1, uintptr_t arg2, + uintptr_t arg3, uintptr_t arg4, + uintptr_t arg5, uintptr_t arg6, + uintptr_t call_id); /** * Indicate whether we are currently running in user mode diff --git a/include/syscall.h b/include/syscall.h index a9dea2ced19..28b6227ce3b 100644 --- a/include/syscall.h +++ b/include/syscall.h @@ -83,9 +83,10 @@ extern "C" { * return void * */ -typedef u32_t (*_k_syscall_handler_t)(u32_t arg1, u32_t arg2, u32_t arg3, - u32_t arg4, u32_t arg5, u32_t arg6, - void *ssf); +typedef uintptr_t (*_k_syscall_handler_t)(uintptr_t arg1, uintptr_t arg2, + uintptr_t arg3, uintptr_t arg4, + uintptr_t arg5, uintptr_t arg6, + void *ssf); /* True if a syscall function must trap to the kernel, usually a * compile-time decision. diff --git a/kernel/userspace.c b/kernel/userspace.c index 8064d178050..3dce3395876 100644 --- a/kernel/userspace.c +++ b/kernel/userspace.c @@ -20,6 +20,7 @@ #include #include #include +#include #ifdef Z_LIBC_PARTITION_EXISTS K_APPMEM_PARTITION_DEFINE(z_libc_partition); @@ -753,16 +754,19 @@ void z_app_shmem_bss_zero(void) * Default handlers if otherwise unimplemented */ -static u32_t handler_bad_syscall(u32_t bad_id, u32_t arg2, u32_t arg3, - u32_t arg4, u32_t arg5, u32_t arg6, void *ssf) +static uintptr_t handler_bad_syscall(uintptr_t bad_id, uintptr_t arg2, + uintptr_t arg3, uintptr_t arg4, + uintptr_t arg5, uintptr_t arg6, + void *ssf) { - LOG_ERR("Bad system call id %u invoked", bad_id); + LOG_ERR("Bad system call id %" PRIuPTR " invoked", bad_id); z_arch_syscall_oops(_current_cpu->syscall_frame); CODE_UNREACHABLE; /* LCOV_EXCL_LINE */ } -static u32_t handler_no_syscall(u32_t arg1, u32_t arg2, u32_t arg3, - u32_t arg4, u32_t arg5, u32_t arg6, void *ssf) +static uintptr_t handler_no_syscall(uintptr_t arg1, uintptr_t arg2, + uintptr_t arg3, uintptr_t arg4, + uintptr_t arg5, uintptr_t arg6, void *ssf) { LOG_ERR("Unimplemented system call"); z_arch_syscall_oops(_current_cpu->syscall_frame); diff --git a/scripts/gen_syscalls.py b/scripts/gen_syscalls.py index 3fc9f09a804..0b070b42cf2 100755 --- a/scripts/gen_syscalls.py +++ b/scripts/gen_syscalls.py @@ -64,7 +64,7 @@ list_template = """ #ifndef _ASMLANGUAGE -#include +#include #endif /* _ASMLANGUAGE */ @@ -107,14 +107,14 @@ extern "C" { """ handler_template = """ -extern u32_t z_hdlr_%s(u32_t arg1, u32_t arg2, u32_t arg3, - u32_t arg4, u32_t arg5, u32_t arg6, void *ssf); +extern uintptr_t z_hdlr_%s(uintptr_t arg1, uintptr_t arg2, uintptr_t arg3, + uintptr_t arg4, uintptr_t arg5, uintptr_t arg6, void *ssf); """ weak_template = """ __weak ALIAS_OF(handler_no_syscall) -u32_t %s(u32_t arg1, u32_t arg2, u32_t arg3, - u32_t arg4, u32_t arg5, u32_t arg6, void *ssf); +uintptr_t %s(uintptr_t arg1, uintptr_t arg2, uintptr_t arg3, + uintptr_t arg4, uintptr_t arg5, uintptr_t arg6, void *ssf); """ @@ -149,7 +149,7 @@ def need_split(argtype): # but it doesn't matter as long as they are consistently # generated. def union_decl(type): - return "union { struct { u32_t lo, hi; } split; %s val; }" % type + return "union { struct { uintptr_t lo, hi; } split; %s val; }" % type def wrapper_defs(func_name, func_type, args): ret64 = func_type in types64 @@ -163,10 +163,10 @@ def wrapper_defs(func_name, func_type, args): mrsh_args.append("parm%d.split.hi" % nsplit) nsplit += 1 else: - mrsh_args.append("*(u32_t *)&" + argname) + mrsh_args.append("*(uintptr_t *)&" + argname) if ret64: - mrsh_args.append("(u32_t)&ret64") + mrsh_args.append("(uintptr_t)&ret64") decl_arglist = ", ".join([" ".join(argrec) for argrec in args]) @@ -183,10 +183,10 @@ def wrapper_defs(func_name, func_type, args): wrap += "\t\t" + "parm%d.val = %s;\n" % (parmnum, argname) if len(mrsh_args) > 6: - wrap += "\t\t" + "u32_t more[] = {\n" + wrap += "\t\t" + "uintptr_t more[] = {\n" wrap += "\t\t\t" + (",\n\t\t\t".join(mrsh_args[5:])) + "\n" wrap += "\t\t" + "};\n" - mrsh_args[5:] = ["(u32_t) &more"] + mrsh_args[5:] = ["(uintptr_t) &more"] syscall_id = "K_SYSCALL_" + func_name.upper() invoke = ("z_arch_syscall_invoke%d(%s)" @@ -225,12 +225,12 @@ def mrsh_rval(mrsh_num, total): if mrsh_num < 5 or total <= 6: return "arg%d" % mrsh_num else: - return "(((u32_t *)more)[%d])" % (mrsh_num - 5) + return "(((uintptr_t *)more)[%d])" % (mrsh_num - 5) def marshall_defs(func_name, func_type, args): mrsh_name = "z_mrsh_" + func_name - nmrsh = 0 # number of marshalled u32_t parameter + nmrsh = 0 # number of marshalled uintptr_t parameter vrfy_parms = [] # list of (arg_num, mrsh_or_parm_num, bool_is_split) split_parms = [] # list of a (arg_num, mrsh_num) for each split for i, (argtype, _) in enumerate(args): @@ -249,11 +249,11 @@ def marshall_defs(func_name, func_type, args): decl_arglist = ", ".join([" ".join(argrec) for argrec in args]) mrsh = "extern %s z_vrfy_%s(%s);\n" % (func_type, func_name, decl_arglist) - mrsh += "u32_t %s(u32_t arg0, u32_t arg1, u32_t arg2,\n" % mrsh_name + mrsh += "uintptr_t %s(uintptr_t arg0, uintptr_t arg1, uintptr_t arg2,\n" % mrsh_name if nmrsh <= 6: - mrsh += "\t\t" + "u32_t arg3, u32_t arg4, u32_t arg5, void *ssf)\n" + mrsh += "\t\t" + "uintptr_t arg3, uintptr_t arg4, uintptr_t arg5, void *ssf)\n" else: - mrsh += "\t\t" + "u32_t arg3, u32_t arg4, void *more, void *ssf)\n" + mrsh += "\t\t" + "uintptr_t arg3, uintptr_t arg4, void *more, void *ssf)\n" mrsh += "{\n" mrsh += "\t" + "_current_cpu->syscall_frame = ssf;\n" @@ -262,7 +262,7 @@ def marshall_defs(func_name, func_type, args): if nmrsh > 6: mrsh += ("\tZ_OOPS(Z_SYSCALL_MEMORY_READ(more, " - + str(nmrsh - 6) + " * sizeof(u32_t)));\n") + + str(nmrsh - 6) + " * sizeof(uintptr_t)));\n") for i, split_rec in enumerate(split_parms): arg_num, mrsh_num = split_rec @@ -293,7 +293,7 @@ def marshall_defs(func_name, func_type, args): mrsh += "\t" + "*%s = ret;\n" % ptr mrsh += "\t" + "return 0;\n" else: - mrsh += "\t" + "return (u32_t) ret;\n" + mrsh += "\t" + "return (uintptr_t) ret;\n" mrsh += "}\n" @@ -384,7 +384,7 @@ def main(): if not name in noweak]) # The "noweak" ones just get a regular declaration - weak_defines += "\n".join(["extern u32_t %s(u32_t arg1, u32_t arg2, u32_t arg3, u32_t arg4, u32_t arg5, u32_t arg6, void *ssf);" + weak_defines += "\n".join(["extern uintptr_t %s(uintptr_t arg1, uintptr_t arg2, uintptr_t arg3, uintptr_t arg4, uintptr_t arg5, uintptr_t arg6, void *ssf);" % s for s in noweak]) fp.write(table_template % (weak_defines,