]> rtime.felk.cvut.cz Git - jailhouse.git/commitdiff
core: make phys_processor_id() return unsigned long
authorAntonios Motakis <antonios.motakis@huawei.com>
Fri, 17 Jun 2016 14:38:41 +0000 (16:38 +0200)
committerJan Kiszka <jan.kiszka@siemens.com>
Sun, 26 Jun 2016 07:16:27 +0000 (09:16 +0200)
32 bits ought not be enough for anybody.

Signed-off-by: Antonios Motakis <antonios.motakis@huawei.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
hypervisor/arch/arm/lib.c
hypervisor/arch/x86/apic.c
hypervisor/arch/x86/control.c
hypervisor/include/jailhouse/printk.h
hypervisor/include/jailhouse/processor.h
hypervisor/printk.c

index c96d18b3e03394d8f377adcef20f1dbc731ebbcb..cf81117b3aabb7d0fd49da7716daef3cece43850 100644 (file)
@@ -15,9 +15,9 @@
 #include <jailhouse/types.h>
 #include <asm/sysregs.h>
 
-int phys_processor_id(void)
+unsigned long phys_processor_id(void)
 {
-       u32 mpidr;
+       unsigned long mpidr;
 
        arm_read_sysreg(MPIDR_EL1, mpidr);
        return mpidr & MPIDR_CPUID_MASK;
index d3b4211be61f95aee506c0608f382b5ef8e22215..e37ecda9928d50d213679677598cd0223ed9dce5 100644 (file)
@@ -112,7 +112,7 @@ static u32 apic_ext_features(void)
                return 0;
 }
 
-int phys_processor_id(void)
+unsigned long phys_processor_id(void)
 {
        return apic_ops.read_id();
 }
@@ -121,7 +121,7 @@ int apic_cpu_init(struct per_cpu *cpu_data)
 {
        unsigned int xlc = MAX((apic_ext_features() >> 16) & 0xff,
                               APIC_REG_XLVT3 - APIC_REG_XLVT0 + 1);
-       unsigned int apic_id = phys_processor_id();
+       unsigned int apic_id = (unsigned int)phys_processor_id();
        unsigned int cpu_id = cpu_data->cpu_id;
        unsigned int n;
        u32 ldr;
index fc8c5b84db6dd84e6c04d0ce5cca5453e4db7048..c58364923f9dd551f0e25693a021b55ce3eebae8 100644 (file)
@@ -300,7 +300,7 @@ x86_exception_handler(struct exception_frame *frame)
                     frame->vector);
        if (frame->error != -1)
                panic_printk("Error code: %x\n", frame->error);
-       panic_printk("Physical CPU ID: %d\n", phys_processor_id());
+       panic_printk("Physical CPU ID: %lu\n", phys_processor_id());
        panic_printk("RIP: %p RSP: %p FLAGS: %x\n", frame->rip, frame->rsp,
                     frame->flags);
        if (frame->vector == PF_VECTOR)
index 891cd1b927dd24f3c38d5de73e53f537854edf51..c226352ccc80cbc275666b07e47b0c26f3eb45ef 100644 (file)
@@ -13,7 +13,7 @@
 #include <jailhouse/types.h>
 
 extern volatile unsigned long panic_in_progress;
-extern unsigned int panic_cpu;
+extern unsigned long panic_cpu;
 
 void printk(const char *fmt, ...);
 
index fd910f5ef0268a3e227791764b18a4b26b9faf2d..4b0d64c08c1f0c82129c4ac1d84c728052281c70 100644 (file)
@@ -12,4 +12,4 @@
 
 #include <asm/processor.h>
 
-int phys_processor_id(void);
+unsigned long phys_processor_id(void);
index faa13266970df9ac35ad0e191acccd68ffd83b5c..8d17a9f0a11a4809c82ef6198db8f9aabc34d111 100644 (file)
@@ -18,7 +18,7 @@
 #include <asm/spinlock.h>
 
 volatile unsigned long panic_in_progress;
-unsigned int panic_cpu = -1;
+unsigned long panic_cpu = -1;
 
 static DEFINE_SPINLOCK(printk_lock);
 
@@ -40,7 +40,7 @@ void printk(const char *fmt, ...)
 
 void panic_printk(const char *fmt, ...)
 {
-       unsigned int cpu_id = phys_processor_id();
+       unsigned long cpu_id = phys_processor_id();
        va_list ap;
 
        if (test_and_set_bit(0, &panic_in_progress) && panic_cpu != cpu_id)