The 6502 port has different stack policies to other processors.
Also while we are at it add uaddr_t so we can support different address
space sizes, ready for a future target or two.
typedef int16_t arg_t;
typedef uint16_t usize_t; /* Largest value passed by userspace */
typedef int16_t susize_t;
+typedef uint16_t uaddr_t;
extern void ei(void);
extern irqflags_t di(void);
extern size_t __fastcall__ strlen(const char *);
#define EMAGIC 0x4C /* Header of executable (JMP) */
+#define brk_limit() ramtop /* Stack is preallocated */
#define staticfast static
} h;
} ticks_t;
-/* We don't yet have bank attributes and banking for Z80 */
+/* We don't yet have bank attributes and banking for 6502 */
#define CODE1
#define CODE2
#define COMMON
typedef int16_t arg_t;
typedef uint16_t usize_t; /* Largest value passed by userspace */
typedef int16_t susize_t;
+typedef uint16_t uaddr_t; /* A user address must fit this */
extern void ei(void);
extern irqflags_t di(void);
extern void irqrestore(irqflags_t f);
#define EMAGIC 0x0E /* Header of executable (JMP) */
+/* Allow a minimum of 512 bytes gap between stack and top of allocations */
+#define brk_limit() (udata.u_syscall_sp - 512)
extern void *memcpy(void *, const void *, size_t);
extern void *memset(void *, int, size_t);
typedef int16_t arg_t; /* Holds arguments */
typedef uint16_t usize_t; /* Largest value passed by userspace */
typedef int16_t susize_t;
+typedef uint16_t uaddr_t; /* User address */
#define ei() do {__asm ei __endasm; } while(0);
/* Z80 binaries start with a JP */
#define EMAGIC 0xc3 /* Header of executable */
+/* Allow a minimum of 512 bytes gap between stack and top of allocations */
+#define brk_limit() (udata.u_syscall_sp - 512)
+
/* compiler provides optimised versions of these: */
#if defined(__SDCC_z80) || defined(__SDCC_z180) || defined(__SDCC_r2k) || defined(__SDCC_r3ka)