From: Kees van Reeuwijk Date: Wed, 6 Jan 2010 08:23:14 +0000 (+0000) Subject: Fixed a typing bug. X-Git-Tag: v3.1.6~107 X-Git-Url: http://zhaoyanbai.com/repos/rndc-confgen.html?a=commitdiff_plain;h=d8f3af3672fbf1a4edf7e205b1c75144c033f5c1;p=minix.git Fixed a typing bug. More explicit type conversion from virual to physical bytes. Bracket negative #defines for extra paranoia. Added a forgotten 'void' to a function. --- diff --git a/kernel/arch/i386/apic.c b/kernel/arch/i386/apic.c index b52a73d87..018c91ba7 100644 --- a/kernel/arch/i386/apic.c +++ b/kernel/arch/i386/apic.c @@ -98,7 +98,7 @@ /* * to make APIC work if SMP is not configured, we need to set the maximal number - * fo CPUS to 1, cpuid to return 0 and the current cpu is always BSP + * of CPUS to 1, cpuid to return 0 and the current cpu is always BSP */ #define CONFIG_MAX_CPUS 1 #define cpu_is_bsp(x) 1 @@ -483,7 +483,7 @@ PRIVATE struct gate_table_s gate_table_common[] = { }; #ifdef CONFIG_APIC_DEBUG -PRIVATE lapic_set_dummy_handlers(void) +PRIVATE void lapic_set_dummy_handlers(void) { char * handler; int vect = 32; diff --git a/kernel/arch/i386/include/archconst.h b/kernel/arch/i386/include/archconst.h index b0e7479d5..9cbaf5e51 100644 --- a/kernel/arch/i386/include/archconst.h +++ b/kernel/arch/i386/include/archconst.h @@ -144,8 +144,8 @@ #define IF_MASK 0x00000200 #define IOPL_MASK 0x003000 -#define vir2phys(vir) (kinfo.data_base + (vir_bytes) (vir)) -#define phys2vir(ph) ((vir_bytes) (ph) - kinfo.data_base) +#define vir2phys(vir) ((phys_bytes)((kinfo.data_base + (vir_bytes) (vir)))) +#define phys2vir(ph) (((vir_bytes)(((vir_bytes) (ph) - kinfo.data_base))) #define INTEL_CPUID_GEN_EBX 0x756e6547 /* ASCII value of "Genu" */ #define INTEL_CPUID_GEN_EDX 0x49656e69 /* ASCII value of "ineI" */ diff --git a/kernel/arch/i386/memory.c b/kernel/arch/i386/memory.c index 7aafa6bf9..4f2b44ec7 100644 --- a/kernel/arch/i386/memory.c +++ b/kernel/arch/i386/memory.c @@ -30,7 +30,7 @@ PRIVATE int psok = 0; u8_t *vm_pagedirs = NULL; -#define NOPDE -1 +#define NOPDE (-1) #define PDEMASK(n) (1L << (n)) PUBLIC u32_t dirtypde; #define WANT_FREEPDES (sizeof(dirtypde)*8-5) diff --git a/kernel/priv.h b/kernel/priv.h index 39a397aaa..12d2d8cff 100644 --- a/kernel/priv.h +++ b/kernel/priv.h @@ -107,7 +107,7 @@ EXTERN struct priv *ppriv_addr[NR_SYS_PROCS]; /* direct slot pointers */ #define USER_PRIV_ID static_priv_id(ROOT_USR_PROC_NR) /* Specifies a null privilege id. */ -#define NULL_PRIV_ID -1 +#define NULL_PRIV_ID (-1) /* Make sure the system can boot. The following sanity check verifies that * the system privileges table is large enough for the number of processes diff --git a/kernel/vm.h b/kernel/vm.h index 6c3473f2b..5587ef76c 100644 --- a/kernel/vm.h +++ b/kernel/vm.h @@ -3,9 +3,9 @@ #define _VM_H 1 /* Pseudo error codes */ -#define VMSUSPEND -996 -#define EFAULT_SRC -995 -#define EFAULT_DST -994 +#define VMSUSPEND (-996) +#define EFAULT_SRC (-995) +#define EFAULT_DST (-994) #define FIXLINMSG(prp) { prp->p_delivermsg_lin = umap_local(prp, D, prp->p_delivermsg_vir, sizeof(message)); }