From 04b1efeff265ebfc3207132a538a99509f2d409b Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Wed, 5 Nov 2014 19:18:51 +0000 Subject: [PATCH] cpu: introduce "staticfast" On Z80 and to an extent 6502 we gain a lot if we can pin some of our auto variables to static addresses. Clearly this can only be done for non-re-entrant functions but our architecture means we have plenty of them 6809 is not really so aflicted so uses auto. --- Kernel/cpu-6502/cpu.h | 2 ++ Kernel/cpu-6809/cpu.h | 6 +++++- Kernel/cpu-z80/cpu.h | 2 ++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Kernel/cpu-6502/cpu.h b/Kernel/cpu-6502/cpu.h index e735a084..8ca9ce37 100644 --- a/Kernel/cpu-6502/cpu.h +++ b/Kernel/cpu-6502/cpu.h @@ -19,3 +19,5 @@ extern void irqrestore(irqflags_t f); extern void *memcpy(void *, void *, size_t); extern void *memset(void *, int, size_t); extern size_t strlen(const char *); + +#define staticfast static diff --git a/Kernel/cpu-6809/cpu.h b/Kernel/cpu-6809/cpu.h index cc116d1c..b7670248 100644 --- a/Kernel/cpu-6809/cpu.h +++ b/Kernel/cpu-6809/cpu.h @@ -19,4 +19,8 @@ extern void irqrestore(irqflags_t f); extern void *memcpy(void *, void *, size_t); extern void *memset(void *, int, size_t); -extern size_t strlen(const char *); \ No newline at end of file +extern size_t strlen(const char *); + +/* 6809 doesn't benefit from making a few key variables in + non-reentrant functions static */ +#define staticfast auto diff --git a/Kernel/cpu-z80/cpu.h b/Kernel/cpu-z80/cpu.h index a88adcd0..ae9b0b0f 100644 --- a/Kernel/cpu-z80/cpu.h +++ b/Kernel/cpu-z80/cpu.h @@ -26,4 +26,6 @@ extern void irqrestore(irqflags_t f); extern int16_t strlen(const char *p); +#define staticfast static + #endif -- 2.34.1