]> Zhao Yanbai Git Server - minix.git/commitdiff
Kernel: resolve -Wall warnings for SMP
authorDavid van Moolenbroek <david@minix3.org>
Tue, 14 Aug 2012 16:38:03 +0000 (16:38 +0000)
committerDavid van Moolenbroek <david@minix3.org>
Tue, 14 Aug 2012 16:38:03 +0000 (16:38 +0000)
kernel/arch/i386/arch_smp.c

index 09f42ff0430f47607203d2ee4e03e8720e728bc8..bc27ac5958960e0d8daf6f82253d7e24eb573c67 100644 (file)
@@ -11,6 +11,7 @@
 #include <unistd.h>
 #include <assert.h>
 #include <stdlib.h>
+#include <string.h>
 #include <machine/archtypes.h>
 #include <archconst.h>
 #include <machine/cmos.h>
@@ -71,7 +72,6 @@ static u32_t ap_lin_addr(void *vaddr)
  */
 void copy_trampoline(void)
 {
-       char * s, *end;
        unsigned tramp_size, tramp_start = (unsigned)&trampoline;;
 
        /* The trampoline code/data is made to be page-aligned. */
@@ -97,7 +97,7 @@ void copy_trampoline(void)
        __ap_idt.base = ap_lin_addr(&__ap_idt_tab);
        __ap_idt.limit = sizeof(idt)-1;
 
-       phys_copy(trampoline, trampoline_base, tramp_size);
+       phys_copy((phys_bytes) trampoline, trampoline_base, tramp_size);
 }
 
 extern int booting_cpu;        /* tell protect.c what to do */
@@ -105,13 +105,13 @@ extern int booting_cpu;   /* tell protect.c what to do */
 static void smp_start_aps(void)
 {
        unsigned cpu;
-       u32_t biosresetvector, *newptpos;
+       u32_t biosresetvector;
        phys_bytes __ap_id_phys;
        struct proc *bootstrap_pt = get_cpulocal_var(ptproc);
 
        /* TODO hack around the alignment problem */
 
-       phys_copy (0x467, &biosresetvector, sizeof(u32_t));
+       phys_copy(0x467, (phys_bytes) &biosresetvector, sizeof(u32_t));
 
        /* set the bios shutdown code to 0xA */
        outb(RTC_INDEX, 0xF);
@@ -129,7 +129,7 @@ static void smp_start_aps(void)
                (phys_bytes) &__ap_id - (phys_bytes)&trampoline;
 
        /* setup the warm reset vector */
-       phys_copy(&trampoline_base, 0x467, sizeof(u32_t));
+       phys_copy((phys_bytes) &trampoline_base, 0x467, sizeof(u32_t));
 
        /* okay, we're ready to go.  boot all of the ap's now.  we loop through
         * using the processor's apic id values.
@@ -143,7 +143,7 @@ static void smp_start_aps(void)
                }
 
                __ap_id = booting_cpu = cpu;
-               phys_copy((void *) &__ap_id, __ap_id_phys, sizeof(__ap_id));
+               phys_copy((phys_bytes) &__ap_id, __ap_id_phys, sizeof(__ap_id));
                mfence();
                if (apic_send_init_ipi(cpu, trampoline_base) ||
                                apic_send_startup_ipi(cpu, trampoline_base)) {
@@ -165,7 +165,7 @@ static void smp_start_aps(void)
                }
        }
 
-       phys_copy(&biosresetvector,(phys_bytes)0x467,sizeof(u32_t));
+       phys_copy((phys_bytes) &biosresetvector, 0x467, sizeof(u32_t));
 
        outb(RTC_INDEX, 0xF);
        outb(RTC_IO, 0);