summaryrefslogtreecommitdiff
path: root/usr/src
diff options
context:
space:
mode:
authorjg <none@none>2005-07-25 12:38:32 -0700
committerjg <none@none>2005-07-25 12:38:32 -0700
commitbcbe91555f717d9e65cf05794295dfe172334908 (patch)
treed2a19ed3ddebb39fadada619d91004bb9f2d1be2 /usr/src
parent884db8ab1a530d69f98f3ed409af0155ed5ae8ea (diff)
downloadillumos-joyent-bcbe91555f717d9e65cf05794295dfe172334908.tar.gz
6274708 gcc and boot really don't get along
Diffstat (limited to 'usr/src')
-rw-r--r--usr/src/psm/stand/boot/amd64/alloc.c15
-rw-r--r--usr/src/psm/stand/boot/amd64/amd64/amd64.h4
-rw-r--r--usr/src/psm/stand/boot/amd64/amd64/print.h4
-rw-r--r--usr/src/psm/stand/boot/amd64/memlist.c6
-rw-r--r--usr/src/psm/stand/boot/common/readfile.c31
-rw-r--r--usr/src/psm/stand/boot/i386/Makefile.com5
-rw-r--r--usr/src/psm/stand/boot/i386/common/boot_ramdisk.c4
-rw-r--r--usr/src/psm/stand/boot/i386/common/bootenv.c6
-rw-r--r--usr/src/psm/stand/boot/i386/common/console.c2
-rw-r--r--usr/src/psm/stand/boot/i386/common/console.h3
-rw-r--r--usr/src/psm/stand/boot/i386/common/memory.c4
-rw-r--r--usr/src/psm/stand/boot/i386/common/standalloc.c20
-rw-r--r--usr/src/psm/stand/boot/i386/common/util.h14
-rw-r--r--usr/src/psm/stand/boot/i386/common/vga.c1
-rw-r--r--usr/src/psm/stand/boot/i386/i86pc/asm.s14
-rw-r--r--usr/src/psm/stand/boot/i386/i86pc/samuldiv64.s52
-rw-r--r--usr/src/stand/lib/inet/dhcpv4.c4
-rw-r--r--usr/src/uts/intel/asm/sunddi.h11
18 files changed, 139 insertions, 61 deletions
diff --git a/usr/src/psm/stand/boot/amd64/alloc.c b/usr/src/psm/stand/boot/amd64/alloc.c
index 0b1181477d..4da403f0e1 100644
--- a/usr/src/psm/stand/boot/amd64/alloc.c
+++ b/usr/src/psm/stand/boot/amd64/alloc.c
@@ -20,7 +20,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -37,13 +37,14 @@ amd64_alloc_identity(size_t size)
{
void *addr;
- if (addr = (void *)idmap_mem((uint32_t)0, size, AMD64_PAGESIZE))
- return (addr);
+ addr = (void *)idmap_mem((uint32_t)0, size, AMD64_PAGESIZE);
- amd64_panic("amd64_alloc_identity: boot failed to identity map 0x%lx "
- "bytes\n", size);
-
- /*NOTREACHED*/
+ if (addr == NULL) {
+ amd64_panic("amd64_alloc_identity: "
+ "boot failed to identity map 0x%lx bytes\n", size);
+ /*NOTREACHED*/
+ }
+ return (addr);
}
void *
diff --git a/usr/src/psm/stand/boot/amd64/amd64/amd64.h b/usr/src/psm/stand/boot/amd64/amd64/amd64.h
index f67a17d485..c7518b84c8 100644
--- a/usr/src/psm/stand/boot/amd64/amd64/amd64.h
+++ b/usr/src/psm/stand/boot/amd64/amd64/amd64.h
@@ -20,7 +20,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -41,7 +41,7 @@ extern "C" {
struct amd64_machregs;
-extern void amd64_system_reset(void);
+extern void amd64_system_reset(void) __NORETURN;
extern const char *amd64_getmmulist(void);
extern int amd64_config_cpu(void);
diff --git a/usr/src/psm/stand/boot/amd64/amd64/print.h b/usr/src/psm/stand/boot/amd64/amd64/print.h
index 80b3edff33..0db7816902 100644
--- a/usr/src/psm/stand/boot/amd64/amd64/print.h
+++ b/usr/src/psm/stand/boot/amd64/amd64/print.h
@@ -20,7 +20,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -47,7 +47,7 @@ extern int amd64_snprintf(char *, size_t, const char *, ...)
extern int amd64_snprintf64(char *, size_t, const char *, ...)
__PRINTFLIKE(3);
extern void amd64_vpanic(const char *, va_list)
- __VPRINTFLIKE(1);
+ __VPRINTFLIKE(1) __NORETURN;
extern void amd64_panic(const char *, ...)
__PRINTFLIKE(1);
extern void amd64_warning(const char *, ...)
diff --git a/usr/src/psm/stand/boot/amd64/memlist.c b/usr/src/psm/stand/boot/amd64/memlist.c
index 023fd240ef..da62480d1d 100644
--- a/usr/src/psm/stand/boot/amd64/memlist.c
+++ b/usr/src/psm/stand/boot/amd64/memlist.c
@@ -20,7 +20,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -57,8 +57,8 @@ amd64_convert_memlist(struct memlist *ml, struct memlist64 *ml64)
* boot will panic if the memlists don't all fit on
* one page so we may as well make the same assumption.
*/
- if ((uint64_t)ml64 > ((uint64_t)amd64_memlistpage +
- AMD64_PAGESIZE))
+ if ((uint64_t)(uintptr_t)ml64 > ((uint64_t)(uintptr_t)
+ amd64_memlistpage + AMD64_PAGESIZE))
amd64_panic("Memory space for 64-bit memlists "
"exhausted when converting memlist @ 0x%x.",
(uint32_t)ml->prev);
diff --git a/usr/src/psm/stand/boot/common/readfile.c b/usr/src/psm/stand/boot/common/readfile.c
index 9e7dda5d9f..7d1f60ac0f 100644
--- a/usr/src/psm/stand/boot/common/readfile.c
+++ b/usr/src/psm/stand/boot/common/readfile.c
@@ -42,6 +42,10 @@
#include <sys/bootvfs.h>
#include <sys/platnames.h>
+#if defined(__i386)
+#include "util.h"
+#endif
+
#ifdef BOOTAMD64
#include <amd64/amd64_page.h>
#endif /* BOOTAMD64 */
@@ -172,7 +176,6 @@ sync_instruction_memory(caddr_t v, size_t len)
extern void sync_instruction_memory(caddr_t v, size_t len);
#endif /* lint */
-
extern int verbosemode;
extern int boothowto;
extern int pagesize;
@@ -934,8 +937,8 @@ read_elf64(int fd, int print, Elf64_Ehdr *elfhdrp)
* We're all set up to read.
* Now let's allocate some memory.
*/
- if (get_progmemory((caddr_t)base, size,
- npagesize))
+ if (get_progmemory((caddr_t)(uintptr_t)base,
+ size, npagesize))
goto elf64error;
}
@@ -944,8 +947,8 @@ read_elf64(int fd, int print, Elf64_Ehdr *elfhdrp)
(u_longlong_t)phdr->p_filesz,
(u_longlong_t)loadaddr);
}
- if (xread(fd, (caddr_t)loadaddr, phdr->p_filesz) !=
- phdr->p_filesz)
+ if (xread(fd, (caddr_t)(uintptr_t)
+ loadaddr, phdr->p_filesz) != phdr->p_filesz)
goto elf64error;
/* zero out BSS */
@@ -958,7 +961,7 @@ read_elf64(int fd, int print, Elf64_Ehdr *elfhdrp)
phdr->p_filesz));
}
- bzero((caddr_t)loadaddr,
+ bzero((caddr_t)(uintptr_t)loadaddr,
phdr->p_memsz - phdr->p_filesz);
bss_seen++;
if (print)
@@ -969,8 +972,8 @@ read_elf64(int fd, int print, Elf64_Ehdr *elfhdrp)
/* force instructions to be visible to icache */
if (phdr->p_flags & PF_X)
- sync_instruction_memory((caddr_t)phdr->p_vaddr,
- phdr->p_memsz);
+ sync_instruction_memory((caddr_t)(uintptr_t)
+ phdr->p_vaddr, phdr->p_memsz);
#ifdef MPSAS
sas_symtab(phdr->p_vaddr,
@@ -1028,7 +1031,7 @@ read_elf64(int fd, int print, Elf64_Ehdr *elfhdrp)
AUX64(av, AT_BASE, entrypt);
AUX64(av, AT_ENTRY, elfhdrp->e_entry);
AUX64(av, AT_PAGESZ, pagesize);
- AUX64(av, AT_PHDR, allphdrs);
+ AUX64(av, AT_PHDR, (uintptr_t)allphdrs);
AUX64(av, AT_PHNUM, elfhdrp->e_phnum);
AUX64(av, AT_PHENT, elfhdrp->e_phentsize);
if (npagesize)
@@ -1045,7 +1048,7 @@ read_elf64(int fd, int print, Elf64_Ehdr *elfhdrp)
AUX64(av, AT_SUN_IFLUSH, icache_flush);
if (cpulist != NULL)
- AUX64(av, AT_SUN_CPU, cpulist);
+ AUX64(av, AT_SUN_CPU, (uintptr_t)cpulist);
AUX64(av, AT_NULL, 0);
/*
* Realloc vectors and copy them.
@@ -1273,7 +1276,7 @@ iload64(char *rtld, Elf64_Phdr *thdr, Elf64_Phdr *dhdr, auxv64_t **avp)
goto errorx;
}
dprintf("Opened %s OK\n", rtld);
- AUX64(*avp, AT_SUN_LDNAME, rtld);
+ AUX64(*avp, AT_SUN_LDNAME, (uintptr_t)rtld);
/*
* Allocate and read the ELF header.
*/
@@ -1370,13 +1373,13 @@ iload64(char *rtld, Elf64_Phdr *thdr, Elf64_Phdr *dhdr, auxv64_t **avp)
* If it's bss, just zero it out.
*/
if (sp->sh_type == SHT_NOBITS) {
- bzero((caddr_t)load, sp->sh_size);
+ bzero((caddr_t)(uintptr_t)load, sp->sh_size);
} else {
/*
* Read the section contents.
*/
if (lseek(fd, sp->sh_offset, 0) == -1 ||
- xread(fd, (caddr_t)load, sp->sh_size) !=
+ xread(fd, (caddr_t)(uintptr_t)load, sp->sh_size) !=
sp->sh_size) {
printf("boot: error reading section %d\n",
i);
@@ -1396,7 +1399,7 @@ iload64(char *rtld, Elf64_Phdr *thdr, Elf64_Phdr *dhdr, auxv64_t **avp)
/* force instructions to be visible to icache */
if (sp->sh_flags & SHF_EXECINSTR)
- sync_instruction_memory((caddr_t)sp->sh_addr,
+ sync_instruction_memory((caddr_t)(uintptr_t)sp->sh_addr,
sp->sh_size);
}
/*
diff --git a/usr/src/psm/stand/boot/i386/Makefile.com b/usr/src/psm/stand/boot/i386/Makefile.com
index be5fc6b0ae..33bf55eb20 100644
--- a/usr/src/psm/stand/boot/i386/Makefile.com
+++ b/usr/src/psm/stand/boot/i386/Makefile.com
@@ -36,6 +36,7 @@ CMN_DIR = $(BOOTSRCDIR)/common
MACH_DIR = ../common
PLAT_DIR = .
PAMD64_DIR = $(BOOTSRCDIR)/amd64
+BOOT_DIR = $(SRC)/psm/stand/boot
TOP_CMN_C_SRC = getoptstr.c string.c ufsops.c hsfs.c
TOP_CMN_C_SRC += memcpy.c memmove.c memset.c bcopy.c bzero.c
@@ -97,12 +98,14 @@ CPPINCS += -I$(TOPDIR)/uts/intel -I$(TOPDIR)/uts/i86pc
CPPINCS += -I$(TOPDIR)/uts/common
CPPINCS += -I$(STANDDIR)/lib/sa
CPPINCS += -I$(STANDDIR)
+CPPINCS += -I$(BOOT_DIR)/i386/common
CPPFLAGS = $(CPPDEFS) $(CPPINCS)
CPPFLAGS += $(CCYFLAG)$(SYSDIR)/common
-ASFLAGS = $(CPPDEFS) -P -D__STDC__ -D_BOOT -D_ASM $(CPPINCS)
+ASFLAGS = -P $(CPPDEFS) -D__STDC__ -D_BOOT -D_ASM $(CPPINCS)
CFLAGS = ../common/i86.il $(COPTFLAG)
+
#
# Force 16-bit alignment in multiboot
#
diff --git a/usr/src/psm/stand/boot/i386/common/boot_ramdisk.c b/usr/src/psm/stand/boot/i386/common/boot_ramdisk.c
index 2b7bc7273c..b380e3149c 100644
--- a/usr/src/psm/stand/boot/i386/common/boot_ramdisk.c
+++ b/usr/src/psm/stand/boot/i386/common/boot_ramdisk.c
@@ -53,8 +53,8 @@ diskread(fileid_t *filep)
/* add in offset of root slice */
blocknum = filep->fi_blocknum;
- diskloc = (caddr_t)(ramdisk_start + blocknum * DEV_BSIZE);
- if (diskloc + filep->fi_count > (caddr_t)ramdisk_end) {
+ diskloc = (caddr_t)(uintptr_t)(ramdisk_start + blocknum * DEV_BSIZE);
+ if (diskloc + filep->fi_count > (caddr_t)(uintptr_t)ramdisk_end) {
printf("diskread: reading beyond end of ramdisk\n");
printf("\tstart = 0x%p, size = 0x%x\n",
(void *)diskloc, filep->fi_count);
diff --git a/usr/src/psm/stand/boot/i386/common/bootenv.c b/usr/src/psm/stand/boot/i386/common/bootenv.c
index 505a0ecb48..30eb186b93 100644
--- a/usr/src/psm/stand/boot/i386/common/bootenv.c
+++ b/usr/src/psm/stand/boot/i386/common/bootenv.c
@@ -29,15 +29,11 @@
#include <sys/types.h>
#include <sys/bootconf.h>
#include <sys/salib.h>
+#include "util.h"
#include "debug.h"
#include "multiboot.h"
#include "bootprop.h"
-extern void prom_init(char *, void *);
-extern void prom_panic(char *);
-extern int openfile(char *, char *);
-extern int close(int);
-
#define BOOTENV_BUFSIZE 4096
#define BOOTENV_LINESIZE 256
diff --git a/usr/src/psm/stand/boot/i386/common/console.c b/usr/src/psm/stand/boot/i386/common/console.c
index c59ffe6e78..9f6dc9cc93 100644
--- a/usr/src/psm/stand/boot/i386/common/console.c
+++ b/usr/src/psm/stand/boot/i386/common/console.c
@@ -31,6 +31,8 @@
#include <sys/varargs.h>
#include <sys/promif.h>
#include <sys/salib.h>
+
+#include "util.h"
#include "serial.h"
#include "chario.h"
#include "vga.h"
diff --git a/usr/src/psm/stand/boot/i386/common/console.h b/usr/src/psm/stand/boot/i386/common/console.h
index 4765780cc6..b06fb5b88e 100644
--- a/usr/src/psm/stand/boot/i386/common/console.h
+++ b/usr/src/psm/stand/boot/i386/common/console.h
@@ -41,8 +41,6 @@ extern "C" {
#define CONS_COLOR 7
-extern uchar_t inb(int);
-extern void outb(int, uchar_t);
extern void kb_init(void);
extern int kb_getchar(void);
extern int kb_ischar(void);
@@ -54,7 +52,6 @@ extern void putchar(int);
extern int getchar(void);
extern int ischar(void);
extern int cons_gets(char *, int);
-extern void reset();
#ifdef __cplusplus
}
diff --git a/usr/src/psm/stand/boot/i386/common/memory.c b/usr/src/psm/stand/boot/i386/common/memory.c
index 31857fb248..591c7781fe 100644
--- a/usr/src/psm/stand/boot/i386/common/memory.c
+++ b/usr/src/psm/stand/boot/i386/common/memory.c
@@ -93,7 +93,7 @@ init_paging(void)
entry = pbooterp;
while (entry) {
(void) map_phys(mode, (size_t)entry->size,
- (caddr_t)entry->address, entry->address);
+ (caddr_t)(uintptr_t)entry->address, entry->address);
entry = entry->next;
}
@@ -101,7 +101,7 @@ init_paging(void)
entry = pramdiskp;
while (entry) {
(void) map_phys(PG_P, (size_t)entry->size,
- (caddr_t)entry->address, entry->address);
+ (caddr_t)(uintptr_t)entry->address, entry->address);
entry = entry->next;
}
diff --git a/usr/src/psm/stand/boot/i386/common/standalloc.c b/usr/src/psm/stand/boot/i386/common/standalloc.c
index 97fce44d83..4e8af8667a 100644
--- a/usr/src/psm/stand/boot/i386/common/standalloc.c
+++ b/usr/src/psm/stand/boot/i386/common/standalloc.c
@@ -346,7 +346,8 @@ idmap_mem(uint32_t virthint, size_t bytes, int align)
return ((caddr_t)0);
if (virthint == 0) {
- addr = (caddr_t)memlist_find(&pfreelistp, bytes, align);
+ addr = (caddr_t)(uintptr_t)
+ memlist_find(&pfreelistp, bytes, align);
} else if (memlist_remove(
&pfreelistp, (uint64_t)virthint, (uint64_t)bytes) == 0) {
addr = (caddr_t)virthint;
@@ -363,20 +364,21 @@ idmap_mem(uint32_t virthint, size_t bytes, int align)
* either map it 1:1 or map it above kernelbase. Hence, the
* corresponding virtual memory is always available by design.
*/
- if (memlist_remove(&vfreelistp, (uint64_t)addr, (uint64_t)bytes) != 0) {
+ if (memlist_remove(&vfreelistp,
+ (uint64_t)(uintptr_t)addr, (uint64_t)bytes) != 0) {
printf("idmap_mem: failed to find virtual "
"0x%lx bytes at 0x%p\n", bytes, (void *)addr);
- (void) memlist_insert(&pfreelistp, (uint64_t)addr,
+ (void) memlist_insert(&pfreelistp, (uint64_t)(uintptr_t)addr,
(uint64_t)bytes);
return (0);
}
- if (map_phys(0, bytes, addr, (uint64_t)addr) == -1) {
+ if (map_phys(0, bytes, addr, (uint64_t)(uintptr_t)addr) == -1) {
printf("idmap_mem: failed to 1:1 map 0x%lx bytes at 0x%p\n",
bytes, (void *)addr);
- (void) memlist_insert(&pfreelistp, (uint64_t)addr,
+ (void) memlist_insert(&pfreelistp, (uint64_t)(uintptr_t)addr,
(uint64_t)bytes);
- (void) memlist_insert(&vfreelistp, (uint64_t)addr,
+ (void) memlist_insert(&vfreelistp, (uint64_t)(uintptr_t)addr,
(uint64_t)bytes);
return (0);
}
@@ -395,7 +397,7 @@ phys_alloc_mem(size_t bytes, int align)
if (bytes == 0)
return ((caddr_t)0);
- return ((caddr_t)memlist_find(&pfreelistp, bytes, align));
+ return ((caddr_t)(uintptr_t)memlist_find(&pfreelistp, bytes, align));
}
/*ARGSUSED*/
@@ -417,7 +419,7 @@ resalloc(enum RESOURCES type, size_t bytes, caddr_t virthint, int align)
case RES_BOOTSCRATCH:
/* scratch memory */
- vaddr = (caddr_t)scratchmem_end;
+ vaddr = (caddr_t)(uintptr_t)scratchmem_end;
bytes = roundup(bytes, PAGESIZE);
scratchmem_end += bytes;
if (scratchmem_end > magic_phys)
@@ -438,7 +440,7 @@ resalloc(enum RESOURCES type, size_t bytes, caddr_t virthint, int align)
bytes = roundup(bytes, PAGESIZE);
if (memlist_remove(&vfreelistp,
- (uint64_t)vaddr, (uint64_t)bytes))
+ (uint64_t)(uintptr_t)vaddr, (uint64_t)bytes))
goto fail; /* virtual memory not available */
if (align == 0)
align = 1;
diff --git a/usr/src/psm/stand/boot/i386/common/util.h b/usr/src/psm/stand/boot/i386/common/util.h
index 798290adbd..61f795eea6 100644
--- a/usr/src/psm/stand/boot/i386/common/util.h
+++ b/usr/src/psm/stand/boot/i386/common/util.h
@@ -32,6 +32,7 @@
#include <sys/types.h>
#include <sys/varargs.h>
#include <sys/promif.h>
+#include "asm/sunddi.h"
/*
* This header file contains most of the libc-like interfaces
@@ -41,6 +42,10 @@
extern "C" {
#endif
+extern uchar_t inb(int);
+extern void outb(int, uint8_t);
+extern void sync_instruction_memory(caddr_t v, size_t len);
+
extern void bzero(void *, size_t);
extern void bcopy(const void *, void *, size_t);
extern size_t strlen(const char *);
@@ -51,8 +56,15 @@ extern char *strcpy(char *, const char *);
extern char *strrchr(const char *, int);
extern char *strstr(const char *, const char *);
+extern void prom_init(char *, void *);
+extern int openfile(char *, char *);
+extern int close(int);
+
extern void printf(const char *, ...);
-extern void panic(const char *, ...);
+
+extern void reset(void) __NORETURN;
+extern void prom_panic(char *fmt) __NORETURN;
+extern void panic(const char *fmt, ...) __NORETURN;
#ifdef __cplusplus
}
diff --git a/usr/src/psm/stand/boot/i386/common/vga.c b/usr/src/psm/stand/boot/i386/common/vga.c
index c9b0f30443..d534894cc3 100644
--- a/usr/src/psm/stand/boot/i386/common/vga.c
+++ b/usr/src/psm/stand/boot/i386/common/vga.c
@@ -32,6 +32,7 @@
#include <sys/archsystm.h>
#include <sys/vgareg.h>
+#include "util.h"
#include "vga.h"
#define VGA_COLOR_CRTC_INDEX 0x3d4
diff --git a/usr/src/psm/stand/boot/i386/i86pc/asm.s b/usr/src/psm/stand/boot/i386/i86pc/asm.s
index be351e4403..0dd66c575c 100644
--- a/usr/src/psm/stand/boot/i386/i86pc/asm.s
+++ b/usr/src/psm/stand/boot/i386/i86pc/asm.s
@@ -306,19 +306,19 @@ donetable:
xorl %eax, %eax
movw %ss, %ax
- movw $0, [i386_REG_SS + 2](%esp)
+ movw $0, _CONST(i386_REG_SS + 2)(%esp)
movl %eax, i386_REG_SS(%esp)
movw %ds, %ax
- movw $0, [i386_REG_DS + 2](%esp)
+ movw $0, _CONST(i386_REG_DS + 2)(%esp)
movl %eax, i386_REG_DS(%esp)
movw %es, %ax
- movw $0, [i386_REG_ES + 2](%esp)
+ movw $0, _CONST(i386_REG_ES + 2)(%esp)
movl %eax, i386_REG_ES(%esp)
movw %fs, %ax
- movw $0, [i386_REG_FS + 2](%esp)
+ movw $0, _CONST(i386_REG_FS + 2)(%esp)
movl %eax, i386_REG_FS(%esp)
movw %gs, %ax
- movw $0, [i386_REG_GS + 2](%esp)
+ movw $0, _CONST(i386_REG_GS + 2)(%esp)
movl %eax, i386_REG_GS(%esp)
/ Save the control registers
@@ -332,11 +332,11 @@ donetable:
movl %eax, i386_REG_CR4(%esp)
/ Save the task, interrupt, gdt, ldt registers
- movw $0, [i386_REG_TR + 2](%esp)
+ movw $0, _CONST(i386_REG_TR + 2)(%esp)
str i386_REG_TR(%esp)
sidt i386_REG_IDT(%esp)
sgdt i386_REG_GDT(%esp)
- movw $0, [i386_REG_LDT + 2](%esp)
+ movw $0, _CONST(i386_REG_LDT + 2)(%esp)
sldt i386_REG_LDT(%esp)
pushl %esp
diff --git a/usr/src/psm/stand/boot/i386/i86pc/samuldiv64.s b/usr/src/psm/stand/boot/i386/i86pc/samuldiv64.s
index 76fc0b1360..fae6774331 100644
--- a/usr/src/psm/stand/boot/i386/i86pc/samuldiv64.s
+++ b/usr/src/psm/stand/boot/i386/i86pc/samuldiv64.s
@@ -1075,3 +1075,55 @@ __rem64(int64_t a, int64_t b)
ret $16
SET_SIZE(__divrem64)
#endif /* lint */
+
+
+#if defined(__lint)
+/*ARGSUSED*/
+unsigned long long
+__udivdi3(unsigned long long a, unsigned long long b)
+{ return (0); }
+
+/*ARGSUSED*/
+unsigned long long
+__umoddi3(unsigned long long a, unsigned long long b)
+{ return (0); }
+
+#else
+
+/*
+ * __udivdi3
+ *
+ * Perform division of two unsigned 64-bit quantities, returning the
+ * quotient in %edx:%eax.
+ */
+ ENTRY(__udivdi3)
+ movl 4(%esp), %eax / x, x
+ movl 8(%esp), %edx / x, x
+ pushl 16(%esp) / y
+ pushl 16(%esp)
+ call UDiv
+ addl $8, %esp
+ ret
+ SET_SIZE(__udivdi3)
+
+/*
+ * __umoddi3
+ *
+ * Perform division of two unsigned 64-bit quantities, returning the
+ * remainder in %edx:%eax.
+ */
+ ENTRY(__umoddi3)
+ subl $12, %esp
+ movl %esp, %ecx /, tmp65
+ movl 16(%esp), %eax / x, x
+ movl 20(%esp), %edx / x, x
+ pushl %ecx / tmp65
+ pushl 32(%esp) / y
+ pushl 32(%esp)
+ call UDivRem
+ movl 12(%esp), %eax / rem, rem
+ movl 16(%esp), %edx / rem, rem
+ addl $24, %esp
+ ret
+ SET_SIZE(__umoddi3)
+#endif
diff --git a/usr/src/stand/lib/inet/dhcpv4.c b/usr/src/stand/lib/inet/dhcpv4.c
index 52d5c4b56b..c09f8965b7 100644
--- a/usr/src/stand/lib/inet/dhcpv4.c
+++ b/usr/src/stand/lib/inet/dhcpv4.c
@@ -20,7 +20,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*
* Standalone dhcp client.
@@ -422,7 +422,7 @@ prt_server_msg(DHCP_OPT *p)
int len = p->len;
char scratch[DHCP_MAX_OPT_SIZE + 1];
- if (p->len > DHCP_MAX_OPT_SIZE)
+ if (len > DHCP_MAX_OPT_SIZE)
len = DHCP_MAX_OPT_SIZE;
bcopy(p->value, scratch, len);
scratch[len] = '\0';
diff --git a/usr/src/uts/intel/asm/sunddi.h b/usr/src/uts/intel/asm/sunddi.h
index 78166905ef..0a6bb3b696 100644
--- a/usr/src/uts/intel/asm/sunddi.h
+++ b/usr/src/uts/intel/asm/sunddi.h
@@ -20,7 +20,7 @@
* CDDL HEADER END
*/
/*
- * Copyright 2004 Sun Microsystems, Inc. All rights reserved.
+ * Copyright 2005 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -105,6 +105,15 @@ extern __inline__ void outl(int port, uint32_t value)
: "a" (value), "d" (port16));
}
+#if defined(_BOOT)
+
+extern __inline__ void sync_instruction_memory(caddr_t v, size_t len)
+{
+ __asm__ __volatile__("nop");
+}
+
+#endif /* _BOOT */
+
#endif /* __i386 || __amd64 */
#endif /* !__lint && __GNUC__ */