From: Ben Gras Date: Wed, 19 Nov 2008 15:40:17 +0000 (+0000) Subject: make allocmem accept and return values in bytes, ramdisk expects this. X-Git-Tag: v3.1.4~222 X-Git-Url: http://zhaoyanbai.com/repos/icons/static/man.3.ps?a=commitdiff_plain;h=9b33056d2b0bbae1a8aa301da40ed1bc99aeaba8;p=minix.git make allocmem accept and return values in bytes, ramdisk expects this. --- diff --git a/boot/boot.c b/boot/boot.c index ddd04fca5..50a42a107 100755 --- a/boot/boot.c +++ b/boot/boot.c @@ -1873,9 +1873,6 @@ void monitor(void) #if BIOS -unsigned char cdspec[25]; -void bootcdinfo(u32_t, int *, int drive); - void boot(void) /* Load Minix and start it, among other things. */ { diff --git a/include/minix/com.h b/include/minix/com.h index 108b0a195..69f5a26d0 100755 --- a/include/minix/com.h +++ b/include/minix/com.h @@ -837,7 +837,7 @@ # define VMUM_LEN m1_i1 #define VM_ALLOCMEM (VM_RQ_BASE+18) -# define VMAM_CLICKS m1_p1 +# define VMAM_BYTES m1_p1 # define VMAM_MEMBASE m1_i1 /* Calls from VFS. */ diff --git a/lib/syslib/vm_allocmem.c b/lib/syslib/vm_allocmem.c index 64e1a791d..725ac54ce 100644 --- a/lib/syslib/vm_allocmem.c +++ b/lib/syslib/vm_allocmem.c @@ -6,12 +6,12 @@ /*===========================================================================* * vm_allocmem * *===========================================================================*/ -PUBLIC int vm_allocmem(phys_clicks clicks, phys_clicks *retmembase) +PUBLIC int vm_allocmem(phys_clicks bytes, phys_clicks *retmembase) { message m; int result; - m.VMAM_CLICKS = clicks; + m.VMAM_BYTES = bytes; result = _taskcall(VM_PROC_NR, VM_ALLOCMEM, &m); if(result == OK) *retmembase = m.VMAM_MEMBASE; diff --git a/servers/pm/misc.c b/servers/pm/misc.c index 5508d8014..4e380cc58 100644 --- a/servers/pm/misc.c +++ b/servers/pm/misc.c @@ -72,7 +72,9 @@ PUBLIC int do_allocmem() r = vm_allocmem(m_in.memsize, &retmembase); if(r == OK) mp->mp_reply.membase = retmembase; +#if 0 printf("PM: do_allocmem: %d\n", r); +#endif return r; } diff --git a/servers/vm/alloc.c b/servers/vm/alloc.c index 196556e29..fe97cf39b 100644 --- a/servers/vm/alloc.c +++ b/servers/vm/alloc.c @@ -817,15 +817,19 @@ PUBLIC void release_dma(struct vmproc *vmp) *===========================================================================*/ PUBLIC int do_allocmem(message *m) { - phys_clicks mem; + phys_clicks mem, clicks; - if((mem=ALLOC_MEM((phys_clicks) m->VMAM_CLICKS, PAF_CLEAR)) == NO_MEM) { + clicks = 1 + ((vir_bytes)m->VMAM_BYTES / CLICK_SIZE); + + if((mem=ALLOC_MEM(clicks, PAF_CLEAR)) == NO_MEM) { return ENOMEM; } - m->VMAM_MEMBASE = mem; + m->VMAM_MEMBASE = CLICK2ABS(mem); +#if 0 printf("VM: do_allocmem: 0x%lx clicks OK at 0x%lx\n", m->VMAM_CLICKS, mem); +#endif return OK; }