diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2020-03-09 21:40:55 +0100 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2020-03-09 21:40:55 +0100 |
commit | eae1961fc21a7c7ebaf2925472631ac404045ab7 (patch) | |
tree | 4a46ea658b133c1c82419763690452e1a5e7e9be | |
parent | 2174deab670da368367d64463b8fa6b82b5be44f (diff) | |
parent | 28b53508aa4cd06933fa1bcbbaa791ad12ecbf51 (diff) |
Merge branch 'master' into master-user_level_drivers
-rw-r--r-- | Makefile.am | 2 | ||||
-rw-r--r-- | doc/mach.texi | 2 | ||||
-rw-r--r-- | i386/i386/fpu.c | 8 | ||||
-rw-r--r-- | include/sys/types.h | 2 | ||||
-rw-r--r-- | kern/startup.c | 7 |
5 files changed, 14 insertions, 7 deletions
diff --git a/Makefile.am b/Makefile.am index 11312a1e..d1968b85 100644 --- a/Makefile.am +++ b/Makefile.am @@ -170,7 +170,7 @@ noinst_PROGRAMS += \ # This is the list of routines we decide is OK to steal from the C library. clib_routines := htonl htons ntohl ntohs \ udivdi3 __udivdi3 __udivmoddi4 __umoddi3 \ - __divdi3 \ + __divdi3 __moddi3 \ __rel_iplt_start __rel_iplt_end \ __ffsdi2 ffs \ _START _start etext _edata end _end # actually ld magic, not libc. diff --git a/doc/mach.texi b/doc/mach.texi index 2bd085b2..dd1e5edd 100644 --- a/doc/mach.texi +++ b/doc/mach.texi @@ -5648,7 +5648,9 @@ mapped-time interface: do @{ secs = mtime->seconds; + __sync_synchronize(); usecs = mtime->microseconds; + __sync_synchronize(); @} while (secs != mtime->check_seconds); @end example diff --git a/i386/i386/fpu.c b/i386/i386/fpu.c index 6ee20150..0887a32c 100644 --- a/i386/i386/fpu.c +++ b/i386/i386/fpu.c @@ -492,7 +492,7 @@ ASSERT_IPL(SPL0); * divide by zero * overflow * - * Use 53-bit precision. + * Use 64-bit precision. */ static void fpinit(thread_t thread) { @@ -508,7 +508,7 @@ ASSERT_IPL(SPL0); { fnstcw(&control); control &= ~(FPC_PC|FPC_RC); /* Clear precision & rounding control */ - control |= (FPC_PC_53 | /* Set precision */ + control |= (FPC_PC_64 | /* Set precision */ FPC_RC_RN | /* round-to-nearest */ FPC_ZE | /* Suppress zero-divide */ FPC_OE | /* and overflow */ @@ -860,7 +860,7 @@ fp_state_alloc(void) if (fp_kind == FP_387X) { ifps->xfp_save_state.fp_control = (0x037f & ~(FPC_IM|FPC_ZM|FPC_OM|FPC_PC)) - | (FPC_PC_53|FPC_IC_AFF); + | (FPC_PC_64|FPC_IC_AFF); ifps->xfp_save_state.fp_status = 0; ifps->xfp_save_state.fp_tag = 0xffff; /* all empty */ if (CPU_HAS_FEATURE(CPU_FEATURE_SSE)) @@ -868,7 +868,7 @@ fp_state_alloc(void) } else { ifps->fp_save_state.fp_control = (0x037f & ~(FPC_IM|FPC_ZM|FPC_OM|FPC_PC)) - | (FPC_PC_53|FPC_IC_AFF); + | (FPC_PC_64|FPC_IC_AFF); ifps->fp_save_state.fp_status = 0; ifps->fp_save_state.fp_tag = 0xffff; /* all empty */ } diff --git a/include/sys/types.h b/include/sys/types.h index d576cc2a..8d5af37a 100644 --- a/include/sys/types.h +++ b/include/sys/types.h @@ -54,7 +54,7 @@ typedef char * caddr_t; /* address of a (signed) char */ #ifndef _TIME_T #define _TIME_T -typedef unsigned int time_t; +typedef unsigned long long time_t; #endif #define RAND_MAX 0x7fffffff diff --git a/kern/startup.c b/kern/startup.c index 5077a0b8..1f873192 100644 --- a/kern/startup.c +++ b/kern/startup.c @@ -90,6 +90,7 @@ extern char *kernel_cmdline; void setup_main(void) { thread_t startup_thread; + phys_addr_t memsize; #if MACH_KDB /* @@ -137,7 +138,11 @@ void setup_main(void) mapable_time_init(); machine_info.max_cpus = NCPUS; - machine_info.memory_size = vm_page_mem_size(); /* XXX phys_addr_t -> vm_size_t */ + memsize = vm_page_mem_size(); + machine_info.memory_size = memsize; + if (machine_info.memory_size < memsize) + /* Overflow, report at least 4GB */ + machine_info.memory_size = ~0; machine_info.avail_cpus = 0; machine_info.major_version = KERNEL_MAJOR_VERSION; machine_info.minor_version = KERNEL_MINOR_VERSION; |