65c816: use brk helper
authorAlan Cox <alan@linux.intel.com>
Tue, 2 Jan 2018 19:20:45 +0000 (19:20 +0000)
committerAlan Cox <alan@linux.intel.com>
Tue, 2 Jan 2018 19:20:45 +0000 (19:20 +0000)
Kernel/cpu-65c816/cpu.h

index e582004..c370fb3 100644 (file)
@@ -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;