From fb6062185dd963975d6d98aa34c4179686e2bbfc Mon Sep 17 00:00:00 2001 From: Ben Gras Date: Wed, 3 May 2006 21:13:45 +0000 Subject: [PATCH] Fixes suggested by Joren for a cleaner g++ compile. --- drivers/memory/memory.c | 2 +- include/assert.h | 4 ++-- include/minix/type.h | 2 +- include/stdlib.h | 2 +- kernel/i8259.c | 2 +- kernel/main.c | 2 +- kernel/protect.c | 6 +++--- kernel/start.c | 6 +++--- kernel/system/do_segctl.c | 2 +- lib/other/putenv.c | 2 +- servers/is/dmp_kernel.c | 2 +- 11 files changed, 16 insertions(+), 16 deletions(-) diff --git a/drivers/memory/memory.c b/drivers/memory/memory.c index b6e49b221..2a07fc125 100644 --- a/drivers/memory/memory.c +++ b/drivers/memory/memory.c @@ -307,7 +307,7 @@ PRIVATE void m_init() if (OK != (s=sys_getmachine(&machine))) { panic("MEM","Couldn't get machine information.",s); } - if (! machine.protected) { + if (! machine.prot) { m_geom[MEM_DEV].dv_size = cvul64(0x100000); /* 1M for 8086 systems */ } else { #if _WORD_SIZE == 2 diff --git a/include/assert.h b/include/assert.h index c97b35fbc..13f3422dd 100755 --- a/include/assert.h +++ b/include/assert.h @@ -25,8 +25,8 @@ #else /* Debugging enabled -- verify assertions at run time. */ #ifdef _ANSI -#define __str(x) # x -#define __xstr(x) __str(x) +#define __makestr(x) # x +#define __xstr(x) __makestr(x) _PROTOTYPE( void __bad_assertion, (const char *_mess) ); #define assert(expr) ((expr)? (void)0 : \ diff --git a/include/minix/type.h b/include/minix/type.h index 06a398be6..737eb8708 100755 --- a/include/minix/type.h +++ b/include/minix/type.h @@ -130,7 +130,7 @@ struct machine { int pc_at; int ps_mca; int processor; - int protected; + int prot; int vdu_ega; int vdu_vga; }; diff --git a/include/stdlib.h b/include/stdlib.h index 8797e3b9c..c21967ef2 100755 --- a/include/stdlib.h +++ b/include/stdlib.h @@ -75,7 +75,7 @@ _PROTOTYPE( int getloadavg, (double *, int) ); #endif #ifdef _MINIX -_PROTOTYPE( int putenv, (const char *_name) ); +_PROTOTYPE( int putenv, (char *_name) ); _PROTOTYPE( int setenv, (const char *name, const char *val, const int f)); /* According to POSIX, getopt should be in unistd.h. What do we do with diff --git a/kernel/i8259.c b/kernel/i8259.c index c832bd9cb..0e487656e 100755 --- a/kernel/i8259.c +++ b/kernel/i8259.c @@ -49,7 +49,7 @@ int mine; intr_disable(); - if (machine.protected) { + if (machine.prot) { /* The AT and newer PS/2 have two interrupt controllers, one master, * one slaved at IRQ 2. (We don't have to deal with the PC that * has just one controller, because it must run in real mode.) diff --git a/kernel/main.c b/kernel/main.c index 33bf1e71f..98a605b65 100755 --- a/kernel/main.c +++ b/kernel/main.c @@ -178,7 +178,7 @@ PRIVATE void announce(void) #if (CHIP == INTEL) /* Real mode, or 16/32-bit protected mode? */ kprintf("Executing in %s mode.\n\n", - machine.protected ? "32-bit protected" : "real"); + machine.prot ? "32-bit protected" : "real"); #endif } diff --git a/kernel/protect.c b/kernel/protect.c index 5f5324d61..a4c2e7693 100755 --- a/kernel/protect.c +++ b/kernel/protect.c @@ -263,7 +263,7 @@ U16_t seg; phys_bytes base; struct segdesc_s *segdp; - if (! machine.protected) { + if (! machine.prot) { base = hclick_to_physb(seg); } else { segdp = &gdt[seg >> 3]; @@ -286,7 +286,7 @@ phys_bytes phys; * address, for use by a driver doing memory I/O in the A0000 - DFFFF range. */ #if _WORD_SIZE == 2 - if (! machine.protected) { + if (! machine.prot) { *seg = phys / HCLICK_SIZE; *off = phys % HCLICK_SIZE; } else { @@ -350,7 +350,7 @@ register struct proc *rp; phys_bytes data_bytes; int privilege; - if (machine.protected) { + if (machine.prot) { data_bytes = (phys_bytes) (rp->p_memmap[S].mem_vir + rp->p_memmap[S].mem_len) << CLICK_SHIFT; if (rp->p_memmap[T].mem_len == 0) diff --git a/kernel/start.c b/kernel/start.c index b77e0342f..1fbad7991 100755 --- a/kernel/start.c +++ b/kernel/start.c @@ -37,7 +37,7 @@ U16_t parmoff, parmsize; /* boot parameters offset and length */ * done below. */ #if _WORD_SIZE != 2 - machine.protected = 1; + machine.prot = 1; #endif /* Record where the kernel and the monitor are. */ @@ -75,9 +75,9 @@ U16_t parmoff, parmsize; /* boot parameters offset and length */ */ machine.processor=atoi(get_value(params, "processor")); #if _WORD_SIZE == 2 - machine.protected = machine.processor >= 286; + machine.prot = machine.processor >= 286; #endif - if (! machine.protected) mon_return = 0; + if (! machine.prot) mon_return = 0; /* XT, AT or MCA bus? */ value = get_value(params, "bus"); diff --git a/kernel/system/do_segctl.c b/kernel/system/do_segctl.c index e1b5b5988..97e56937f 100644 --- a/kernel/system/do_segctl.c +++ b/kernel/system/do_segctl.c @@ -44,7 +44,7 @@ register message *m_ptr; /* pointer to request message */ } if (index < 0) return(ENOSPC); - if (! machine.protected) { + if (! machine.prot) { selector = phys / HCLICK_SIZE; offset = phys % HCLICK_SIZE; result = OK; diff --git a/lib/other/putenv.c b/lib/other/putenv.c index d49ab9d0a..455ad5c5b 100755 --- a/lib/other/putenv.c +++ b/lib/other/putenv.c @@ -14,7 +14,7 @@ extern _CONST char ***_penviron; int putenv(name) -_CONST char *name; +char *name; { register _CONST char **v = *_penviron; register char *r; diff --git a/servers/is/dmp_kernel.c b/servers/is/dmp_kernel.c index 7b08c892c..269f4ebc3 100644 --- a/servers/is/dmp_kernel.c +++ b/servers/is/dmp_kernel.c @@ -292,7 +292,7 @@ PUBLIC void kenv_dmp() printf("- pc_at: %3d\n", machine.pc_at); printf("- ps_mca: %3d\n", machine.ps_mca); printf("- processor: %3d\n", machine.processor); - printf("- protected: %3d\n", machine.protected); + printf("- protected: %3d\n", machine.prot); printf("- vdu_ega: %3d\n", machine.vdu_ega); printf("- vdu_vga: %3d\n\n", machine.vdu_vga); printf("Kernel info structure:\n"); -- 2.44.0