From 0a1bb6c1c953fe28e490172e2289806d64e38177 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Tue, 2 Jan 2018 19:20:45 +0000 Subject: [PATCH] 65c816: use brk helper --- Kernel/cpu-65c816/cpu.h | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/Kernel/cpu-65c816/cpu.h b/Kernel/cpu-65c816/cpu.h index e5820046..c370fb33 100644 --- a/Kernel/cpu-65c816/cpu.h +++ b/Kernel/cpu-65c816/cpu.h @@ -5,7 +5,7 @@ * direct page likewise. * * Because cc65 stores temporaries and return addresses on the CPU stack, - * and uses ZP for register variables (who in C you cannot take the + * and uses ZP for register variables (whom in C you cannot take the * address of) this works fine for CC65 apps and the kernel likewise only * has to worry about 16bit pointers except for user copies and asm bits. */ @@ -42,13 +42,11 @@ extern size_t __fastcall__ strlen(const char *); /* We use SEC BCS not CLC BCC because CLC is 0x18 which is the Z80 JR header so the two would be identical - not good! */ - -/* High byte is saved, low byte is a mystery so take worst case. Also allow - a bit less as C stack is not return stack */ -#define brk_limit() ((((uint16_t)udata.u_syscall_sp) | 0xFF) - 384) - #define staticfast static +/* Handled with an asm helper on this processor due to the dual stacks */ +extern uint16_t brk_limit(void); + /* User's structure for times() system call */ typedef unsigned long clock_t; -- 2.34.1