From fe728c704174ea906a520a9b71b6cf0af8002363 Mon Sep 17 00:00:00 2001 From: Alan Cox Date: Wed, 14 Sep 2016 13:30:40 +0100 Subject: [PATCH] types: more type tidy up --- Kernel/flat.c | 2 +- Kernel/flat_mem.c | 2 +- Kernel/include/kernel32.h | 2 +- Kernel/syscall_exec32.c | 10 +++++----- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/Kernel/flat.c b/Kernel/flat.c index c58a13d7..16dd3602 100644 --- a/Kernel/flat.c +++ b/Kernel/flat.c @@ -254,7 +254,7 @@ unsigned long pagemap_mem_used(void) /* Extra helper for exec32 */ -uint8_t *pagemap_base(void) +uaddr_t pagemap_base(void) { unsigned int proc = udata.u_page; return mem[proc]->memblk[0].start; diff --git a/Kernel/flat_mem.c b/Kernel/flat_mem.c index 20de5c36..d0404830 100644 --- a/Kernel/flat_mem.c +++ b/Kernel/flat_mem.c @@ -524,7 +524,7 @@ int pagemap_realloc(usize_t size) return 0; } -uint8_t *pagemap_base(void) +uaddr_t pagemap_base(void) { return mmu_context[udata.u_page].base; } diff --git a/Kernel/include/kernel32.h b/Kernel/include/kernel32.h index 44d7edaa..e1c6924a 100644 --- a/Kernel/include/kernel32.h +++ b/Kernel/include/kernel32.h @@ -15,7 +15,7 @@ extern unsigned long kmemused(void); /* flat.c */ extern void pagemap_switch(ptptr p); -extern uint8_t *pagemap_base(void); +extern uaddr_t pagemap_base(void); #define PROGLOAD pagemap_base() extern uint32_t ugetl(void *uaddr, int *err); extern int uputl(uint32_t val, void *uaddr); diff --git a/Kernel/syscall_exec32.c b/Kernel/syscall_exec32.c index 7239df4a..6ff23771 100644 --- a/Kernel/syscall_exec32.c +++ b/Kernel/syscall_exec32.c @@ -91,14 +91,14 @@ static int valid_hdr(inoptr ino, struct binfmt_flat *bf) /* For now we load the binary in one block, including code/data/bss. We can look at better formats, split binaries etc later maybe */ -static void relocate(struct binfmt_flat *bf, uint8_t *progbase, uint32_t size) +static void relocate(struct binfmt_flat *bf, uaddr_t progbase, uint32_t size) { uint32_t *rp = (uint32_t *)(progbase + bf->reloc_start); uint32_t n = bf->reloc_count; while (n--) { uint32_t v = *rp++; if (v < size && !(v&1)) /* Revisit for non 68K */ - *((uint32_t *)(rp + v)) += (uint32_t)progbase; + *((uint32_t *)(rp + v)) += progbase; } } @@ -124,7 +124,7 @@ arg_t _execve(void) struct s_argblk *abuf, *ebuf; int argc; uint32_t bin_size; /* Will need to be bigger on some cpus */ - uint8_t *progbase, *top; + uaddr_t progbase, top; uaddr_t go; if (!(ino = n_open(name, NULLINOPTR))) @@ -207,13 +207,13 @@ arg_t _execve(void) bin_size = binflat->reloc_start + 4 * binflat->reloc_count; if (bin_size > 512) - bload(ino, 1, progbase + 512, bin_size - 512); + bload(ino, 1, (uint8_t *)progbase + 512, bin_size - 512); go = (uint32_t)progbase + binflat->entry; relocate(binflat, progbase, bin_size); /* This may wipe the relocations */ - uzero(progbase + binflat->data_end, + uzero((uint8_t *)progbase + binflat->data_end, binflat->bss_end - binflat->data_end + binflat->stack_size); brelse(buf); -- 2.34.1