cpu: introduce "staticfast"
authorAlan Cox <alan@etchedpixels.co.uk>
Wed, 5 Nov 2014 19:18:51 +0000 (19:18 +0000)
committerAlan Cox <alan@etchedpixels.co.uk>
Wed, 5 Nov 2014 19:18:51 +0000 (19:18 +0000)
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
Kernel/cpu-6809/cpu.h
Kernel/cpu-z80/cpu.h

index e735a08..8ca9ce3 100644 (file)
@@ -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
index cc116d1..b767024 100644 (file)
@@ -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
index a88adcd..ae9b0b0 100644 (file)
@@ -26,4 +26,6 @@ extern void irqrestore(irqflags_t f);
 
 extern int16_t strlen(const char *p);
 
+#define        staticfast      static
+
 #endif