kernel: remaining bits of type fixing
authorAlan Cox <alan@linux.intel.com>
Tue, 13 Sep 2016 22:35:53 +0000 (23:35 +0100)
committerAlan Cox <alan@linux.intel.com>
Tue, 13 Sep 2016 22:35:53 +0000 (23:35 +0100)
With these fixed we can mount the root fs on 68000

Kernel/include/kdata.h
Kernel/include/kernel.h
Kernel/kdata.c
Kernel/start.c

index 2886325..eadfd1e 100644 (file)
@@ -3,7 +3,7 @@
 
 #include <stdbool.h>
 
-extern unsigned char *cmdline;
+extern char *cmdline;
 
 extern struct u_block ub;
 
index b1be3a0..2101d37 100644 (file)
@@ -456,7 +456,7 @@ typedef struct u_data {
     /* Temporaries used for block I/O */
     blkno_t    u_block;        /* Block number */
     uint16_t   u_blkoff;       /* Offset in block */
-    uint16_t   u_nblock;       /* Number of blocks */
+    usize_t    u_nblock;       /* Number of blocks */
     uint8_t    *u_dptr;        /* Address for I/O */
 
 #ifdef CONFIG_LEVEL_2
@@ -685,10 +685,12 @@ extern usize_t valaddr(const char *base, usize_t size);
 extern int uget(const void *userspace_source, void *dest, usize_t count);
 extern int16_t  ugetc(const void *userspace_source);
 extern uint16_t ugetw(const void *userspace_source);
+extern uint32_t _ugetl(void *uaddr);
 extern int ugets(const void *userspace_source, void *dest, usize_t maxlen);
 extern int uput (const void *source,   void *userspace_dest, usize_t count);
 extern int uputc(uint16_t value,  void *userspace_dest);       /* u16_t so we don't get wacky 8bit stack games */
 extern int uputw(uint16_t value, void *userspace_dest);
+extern int _uputl(uint32_t val, void *uaddr);
 extern int uzero(void *userspace_dest, usize_t count);
 
 /* usermem.c or usermem_std.s */
@@ -850,10 +852,10 @@ extern int _select(void);
 /* swap.c */
 extern uint16_t swappage;
 
-extern int swapread(uint16_t dev, blkno_t blkno, unsigned int nbytes,
-                    uint16_t buf, uint16_t page);
-extern int swapwrite(uint16_t dev, blkno_t blkno, unsigned int nbytes,
-                    uint16_t buf, uint16_t page);
+extern int swapread(uint16_t dev, blkno_t blkno, usize_t nbytes,
+                    uaddr_t buf, uint16_t page);
+extern int swapwrite(uint16_t dev, blkno_t blkno, usize_t nbytes,
+                    uaddr_t buf, uint16_t page);
 
 extern void swapmap_add(uint8_t swap);
 extern int swapmap_alloc(void);
@@ -892,7 +894,7 @@ extern void platform_discard(void);
 extern void platform_idle(void);
 extern uint8_t rtc_secs(void);
 extern void trap_reboot(void);
-extern uint8_t platform_param(unsigned char *p);
+extern uint8_t platform_param(char *p);
 
 /* Will need a uptr_t eventually */
 extern uaddr_t ramtop;      /* Note: ramtop must be in common in some cases */
index 4a4ed6e..99b7ccf 100644 (file)
@@ -4,7 +4,7 @@
 #include <netdev.h>
 
 p_tab *init_process;
-unsigned char *cmdline = (unsigned char *) CMDLINE;
+char *cmdline = (unsigned char *) CMDLINE;
 uint16_t ramsize, procmem, maxproc, nproc;
 uint8_t nready;
 uint16_t runticks;
index 6545ceb..89b3eb1 100644 (file)
@@ -158,7 +158,7 @@ void complete_init(void)
 #define BOOTDEVICENAMES "" /* numeric parsing only */
 #endif
 
-static uint8_t system_param(unsigned char *p)
+static uint8_t system_param(char *p)
 {
        if (*p == 'r' && p[2] == 0) {
                if (p[1] == 'o') {
@@ -174,9 +174,9 @@ static uint8_t system_param(unsigned char *p)
 }
 
 /* Parse other arguments */
-void parse_args(unsigned char *p)
+void parse_args(char *p)
 {
-       unsigned char *s; 
+       char *s;
        while(*p) {
                while(*p == ' ' || *p == '\n')
                        p++;
@@ -191,11 +191,11 @@ void parse_args(unsigned char *p)
        }
 }
 
-uint16_t bootdevice(uint8_t *devname)
+uint16_t bootdevice(char *devname)
 {
        bool match = true;
        unsigned int b = 0, n = 0;
-       uint8_t *p;
+       char *p;
        const uint8_t *bdn = (const uint8_t *)BOOTDEVICENAMES;
        uint8_t c, pc;
 
@@ -272,7 +272,7 @@ uint16_t bootdevice(uint8_t *devname)
 }
 
 /* So its in discard and thrown not on stack */
-static uint8_t bootline[64];
+static char bootline[64];
 
 uint16_t get_root_dev(void)
 {
@@ -283,7 +283,7 @@ uint16_t get_root_dev(void)
 
        while(rd == BAD_ROOT_DEV){
                kputs("bootdev: ");
-               udata.u_base = bootline;
+               udata.u_base = (uint8_t *)bootline;
                udata.u_sysio = 1;
                udata.u_count = sizeof(bootline)-1;
                udata.u_euid = 0;               /* Always begin as superuser */
@@ -308,7 +308,9 @@ void fuzix_main(void)
        inint = false;
        udata.u_insys = true;
 
-       ramtop = PROGTOP;
+#ifdef PROGTOP         /* FIXME */
+       ramtop = (uaddr_t)PROGTOP;
+#endif
 
        tty_init();