]> Zhao Yanbai Git Server - minix.git/commitdiff
make allocmem accept and return values in bytes, ramdisk expects this.
authorBen Gras <ben@minix3.org>
Wed, 19 Nov 2008 15:40:17 +0000 (15:40 +0000)
committerBen Gras <ben@minix3.org>
Wed, 19 Nov 2008 15:40:17 +0000 (15:40 +0000)
boot/boot.c
include/minix/com.h
lib/syslib/vm_allocmem.c
servers/pm/misc.c
servers/vm/alloc.c

index ddd04fca5142b65df1dcc11d90fce495ade4ca2e..50a42a107a33559e0316319ce1b37a9c5d9cd6fd 100755 (executable)
@@ -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. */
 {
index 108b0a195351eec6b4d042414999c994abaa8adf..69f5a26d01ac387fb1de6bad24b819cff7bf177d 100755 (executable)
 #      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. */
index 64e1a791d31b410661074e61c5c3225304bcc917..725ac54cecf5823e985f5e9dd368f0c7f372f013 100644 (file)
@@ -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;
index 5508d80142e150e45b0fea691e47fe406029003f..4e380cc584efe56c94968ed63c8a998defd56a0f 100644 (file)
@@ -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;
 }
 
index 196556e2936b43b113559c0781a2188c61256c3e..fe97cf39ba06b1df391a57e669160829dec34c33 100644 (file)
@@ -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;
 }