From: Alan Cox Date: Tue, 13 Sep 2016 22:35:53 +0000 (+0100) Subject: kernel: remaining bits of type fixing X-Git-Url: https://git.ndcode.org/public/gitweb.cgi?a=commitdiff_plain;h=aa615e61f64de8a21b529a543dffd219c0beb030;p=FUZIX.git kernel: remaining bits of type fixing With these fixed we can mount the root fs on 68000 --- diff --git a/Kernel/include/kdata.h b/Kernel/include/kdata.h index 28863251..eadfd1e9 100644 --- a/Kernel/include/kdata.h +++ b/Kernel/include/kdata.h @@ -3,7 +3,7 @@ #include -extern unsigned char *cmdline; +extern char *cmdline; extern struct u_block ub; diff --git a/Kernel/include/kernel.h b/Kernel/include/kernel.h index b1be3a00..2101d373 100644 --- a/Kernel/include/kernel.h +++ b/Kernel/include/kernel.h @@ -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 */ diff --git a/Kernel/kdata.c b/Kernel/kdata.c index 4a4ed6e0..99b7ccf3 100644 --- a/Kernel/kdata.c +++ b/Kernel/kdata.c @@ -4,7 +4,7 @@ #include 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; diff --git a/Kernel/start.c b/Kernel/start.c index 6545ceb9..89b3eb14 100644 --- a/Kernel/start.c +++ b/Kernel/start.c @@ -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();