diff --git a/usr/src/uts/i86pc/dboot/dboot_startkern.c b/usr/src/uts/i86pc/dboot/dboot_startkern.c index 2438dc62926c..8268f4cd4b21 100644 --- a/usr/src/uts/i86pc/dboot/dboot_startkern.c +++ b/usr/src/uts/i86pc/dboot/dboot_startkern.c @@ -237,7 +237,7 @@ sort_physinstall(void) memlists[i].next = 0; memlists[i - 1].next = (native_ptr_t)(uintptr_t)(memlists + i); } - bi->bi_phys_install = (native_ptr_t)memlists; + bi->bi_phys_install = (native_ptr_t)(uintptr_t)memlists; DBG(bi->bi_phys_install); } @@ -258,7 +258,7 @@ build_rsvdmemlists(void) rsvdmemlists[i - 1].next = (native_ptr_t)(uintptr_t)(rsvdmemlists + i); } - bi->bi_rsvdmem = (native_ptr_t)rsvdmemlists; + bi->bi_rsvdmem = (native_ptr_t)(uintptr_t)rsvdmemlists; DBG(bi->bi_rsvdmem); } @@ -668,7 +668,7 @@ build_pcimemlists(mmap_t *mem, int num) pcimemlists[i - 1].next = (native_ptr_t)(uintptr_t)(pcimemlists + i); } - bi->bi_pcimem = (native_ptr_t)pcimemlists; + bi->bi_pcimem = (native_ptr_t)(uintptr_t)pcimemlists; DBG(bi->bi_pcimem); } @@ -808,7 +808,7 @@ init_mem_alloc(void) * we'll build the module list while we're walking through here */ DBG_MSG("\nFinding Modules\n"); - check_higher((paddr_t)&_end); + check_higher((paddr_t)(uintptr_t)&_end); for (mod = (mb_module_t *)(mb_info->mods_addr), i = 0; i < mb_info->mods_count; ++mod, ++i) { @@ -826,7 +826,7 @@ init_mem_alloc(void) check_higher(mod->mod_end); } - bi->bi_modules = (native_ptr_t)modules; + bi->bi_modules = (native_ptr_t)(uintptr_t)modules; DBG(bi->bi_modules); bi->bi_module_cnt = mb_info->mods_count; DBG(bi->bi_module_cnt); @@ -911,7 +911,7 @@ init_mem_alloc(void) pcimemlists[0].size = pci_hi_limit - pcimemlists[0].addr; pcimemlists[0].next = 0; pcimemlists[0].prev = 0; - bi->bi_pcimem = (native_ptr_t)pcimemlists; + bi->bi_pcimem = (native_ptr_t)(uintptr_t)pcimemlists; DBG(bi->bi_pcimem); } else { dboot_panic("No memory info from boot loader!!!"); diff --git a/usr/src/uts/i86pc/os/mp_pc.c b/usr/src/uts/i86pc/os/mp_pc.c index 4ba4612abde1..e2dbce209108 100644 --- a/usr/src/uts/i86pc/os/mp_pc.c +++ b/usr/src/uts/i86pc/os/mp_pc.c @@ -165,7 +165,8 @@ rmp_gdt_init(rm_platter_t *rm) * mapped address, we need to calculate it here. */ rm->rm_longmode64_addr = rm_platter_pa + - ((uint32_t)long_mode_64 - (uint32_t)real_mode_start_cpu); + (uint32_t)((uintptr_t)long_mode_64 - + (uintptr_t)real_mode_start_cpu); #endif /* __amd64 */ } diff --git a/usr/src/uts/intel/sys/segments.h b/usr/src/uts/intel/sys/segments.h index e0bc76a02334..c4b194fcd813 100644 --- a/usr/src/uts/intel/sys/segments.h +++ b/usr/src/uts/intel/sys/segments.h @@ -352,8 +352,8 @@ typedef struct gate_desc { uint32_t sgd_hioffset:16; /* code seg off 31:16 */ } gate_desc_t; -#define GATESEG_GETOFFSET(sgd) ((sgd)->sgd_looffset | \ - (sgd)->sgd_hioffset << 16) +#define GATESEG_GETOFFSET(sgd) ((uintptr_t)((sgd)->sgd_looffset | \ + (sgd)->sgd_hioffset << 16)) #else /* __amd64 */ @@ -380,9 +380,9 @@ typedef struct gate_desc { uint64_t sgd_resv3:19; /* unused, ignored */ } gate_desc_t; -#define GATESEG_GETOFFSET(sgd) ((sgd)->sgd_looffset | \ - (sgd)->sgd_hioffset << 16 | \ - (sgd)->sgd_hi64offset << 32) +#define GATESEG_GETOFFSET(sgd) ((uintptr_t)((sgd)->sgd_looffset | \ + (sgd)->sgd_hioffset << 16 | \ + (uint64_t)((sgd)->sgd_hi64offset) << 32)) #endif /* __amd64 */