lowlevel-z80: support the experimental entry optimisation
authorAlan Cox <alan@linux.intel.com>
Mon, 2 Feb 2015 22:29:44 +0000 (22:29 +0000)
committerAlan Cox <alan@linux.intel.com>
Mon, 2 Feb 2015 22:29:44 +0000 (22:29 +0000)
Kernel/lowlevel-z80.s

index c923d5e..5037bbb 100644 (file)
@@ -546,3 +546,30 @@ numeral:add a, #0x30 ; start at '0' (0x30='0')
 .else
        .include "lowlevel-z80-cmos.s"
 .endif
+
+;
+;      These are needed by the experimental SDCC size optimisations
+;
+
+       .globl __enter, __enter_s
+
+__enter:
+       pop hl          ; return address
+       push ix         ; save frame pointer
+       ld ix, #0
+       add ix, sp      ; set ix to the stack frame
+       jp (hl)         ; and return
+
+__enter_s:
+       pop hl          ; return address
+       push ix         ; save frame pointer
+       ld ix, #0
+       add ix, sp      ; frame pointer
+       ld e, (hl)      ; size byte
+       ld d, #0xFF     ; always minus something..
+       inc hl
+       ex de, hl
+       add hl, sp
+       ld sp, hl
+       push de
+       ret