zx128: switch to mainline bankfixed
authorAlan Cox <alan@linux.intel.com>
Fri, 13 Feb 2015 15:46:58 +0000 (15:46 +0000)
committerAlan Cox <alan@linux.intel.com>
Fri, 13 Feb 2015 15:46:58 +0000 (15:46 +0000)
It now handles the cases that prevented it being used

Kernel/platform-zx128/Makefile
Kernel/platform-zx128/bankzx128.c [deleted file]
Kernel/platform-zx128/config.h
Kernel/platform-zx128/fuzix.lnk

index 8ef7ed4..37f4a14 100644 (file)
@@ -1,4 +1,4 @@
-CSRCS = devtty.c bankzx128.c devices.c main.c devmdv.c
+CSRCS = devtty.c devices.c main.c devmdv.c
 DSRCS = ../dev/devide.c ../dev/mbr.c ../dev/blkdev.c
 DDSRCS = ../dev/devide_discard.c
 ASRCS = crt0.s zx128.s zxvideo.s microdrive.s
diff --git a/Kernel/platform-zx128/bankzx128.c b/Kernel/platform-zx128/bankzx128.c
deleted file mode 100644 (file)
index ef5b320..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-#include <kernel.h>
-#include <timer.h>
-#include <kdata.h>
-#include <printf.h>
-
-/* This is copied version of bankfixed.c
-   The only difference is pagemap_realloc function.
-   Since we have PROGBASE at 0xC000, pagemap_realloc
-   returned ENOMEM even when 0 bytes were requested
-
-   FIXME: need to redo this in pairs and add swap */
-
-/* Kernel is 0, apps 1,2,3 etc */
-static unsigned char pfree[MAX_MAPS];
-static unsigned char pfptr = 0;
-static unsigned char pfmax;
-
-void pagemap_add(uint8_t page)
-{
-       pfree[pfptr++] = page;
-       pfmax = pfptr;
-}
-
-void pagemap_free(ptptr p)
-{
-       if (p->p_page == 0)
-               panic("free0");
-       pfree[pfptr++] = p->p_page;
-}
-
-int pagemap_alloc(ptptr p)
-{
-#ifdef SWAP_DEV
-       if (pfptr == 0) {
-               swapneeded(p, 1);
-       }
-#endif
-       if (pfptr == 0)
-               return ENOMEM;
-       p->p_page = pfree[--pfptr];
-       return 0;
-}
-
-/* Realloc is trivial - we can't do anything useful */
-int pagemap_realloc(uint16_t size)
-{
-       if (size - PROGBASE >= MAP_SIZE)
-               return ENOMEM;
-       return 0;
-}
-
-uint16_t pagemap_mem_used(void)
-{
-       return (pfmax - pfptr) * (MAP_SIZE >> 10);
-}
index 4d352cd..9235758 100644 (file)
 #undef CONFIG_FONT8X8
 #undef CONFIG_FONT8X8SMALL
 
-/* We have 1 bank at C000 with 6 possible pages to map.
-   Our choice should be CONFIG_BANK_FIXED, but we are.
-   using custom implementation of it */
-
-#undef CONFIG_BANK_FIXED
+/* Two fixed banks in use */
+#define CONFIG_BANK_FIXED
 
 /* We have two mappings from our 128K of memory */
 #define MAX_MAPS       2
index 0d3d2b6..56a58d1 100644 (file)
@@ -35,7 +35,7 @@ tty.rel
 vt.rel
 font8x8.rel
 mm.rel
-platform-zx128/bankzx128.rel
+bankfixed.rel
 swap.rel
 devsys.rel
 platform-zx128/devtty.rel