PERFORCE change 87179 for review

Olivier Houchard cognet at FreeBSD.org
Thu Nov 24 05:31:34 PST 2005


http://perforce.freebsd.org/chv.cgi?CH=87179

Change 87179 by cognet at cognet on 2005/11/24 13:30:53

	IFC

Affected files ...

.. //depot/projects/arm/src/sys/amd64/amd64/machdep.c#6 integrate
.. //depot/projects/arm/src/sys/arm/arm/cpufunc_asm_arm9.S#3 integrate
.. //depot/projects/arm/src/sys/arm/arm/elf_trampoline.c#2 integrate
.. //depot/projects/arm/src/sys/arm/arm/machdep.c#5 integrate
.. //depot/projects/arm/src/sys/arm/include/elf.h#2 integrate
.. //depot/projects/arm/src/sys/arm/xscale/i80321/iq31244_machdep.c#5 integrate
.. //depot/projects/arm/src/sys/compat/ndis/subr_ntoskrnl.c#6 integrate
.. //depot/projects/arm/src/sys/conf/Makefile.arm#4 integrate
.. //depot/projects/arm/src/sys/conf/files#6 integrate
.. //depot/projects/arm/src/sys/conf/files.powerpc#3 integrate
.. //depot/projects/arm/src/sys/conf/files.sparc64#3 integrate
.. //depot/projects/arm/src/sys/conf/ldscript.arm#2 integrate
.. //depot/projects/arm/src/sys/conf/options#6 integrate
.. //depot/projects/arm/src/sys/conf/options.i386#4 integrate
.. //depot/projects/arm/src/sys/conf/options.pc98#3 integrate
.. //depot/projects/arm/src/sys/dev/acpica/acpi_battery.c#4 integrate
.. //depot/projects/arm/src/sys/dev/acpica/acpi_cmbat.c#3 integrate
.. //depot/projects/arm/src/sys/dev/acpica/acpi_pci_link.c#3 integrate
.. //depot/projects/arm/src/sys/dev/acpica/acpi_smbat.c#2 integrate
.. //depot/projects/arm/src/sys/dev/dc/if_dc.c#2 integrate
.. //depot/projects/arm/src/sys/dev/dc/if_dcreg.h#2 integrate
.. //depot/projects/arm/src/sys/dev/em/if_em.c#5 integrate
.. //depot/projects/arm/src/sys/dev/em/if_em_hw.c#3 integrate
.. //depot/projects/arm/src/sys/dev/em/if_em_hw.h#4 integrate
.. //depot/projects/arm/src/sys/dev/lge/if_lge.c#4 integrate
.. //depot/projects/arm/src/sys/dev/lge/if_lgereg.h#3 integrate
.. //depot/projects/arm/src/sys/dev/nve/if_nve.c#3 integrate
.. //depot/projects/arm/src/sys/dev/nve/if_nvereg.h#3 integrate
.. //depot/projects/arm/src/sys/dev/ofw/ofw_bus_if.m#2 integrate
.. //depot/projects/arm/src/sys/dev/ofw/ofw_bus_subr.c#1 branch
.. //depot/projects/arm/src/sys/dev/ofw/ofw_bus_subr.h#1 branch
.. //depot/projects/arm/src/sys/dev/ofw/openfirm.c#2 integrate
.. //depot/projects/arm/src/sys/dev/ral/if_ral.c#2 integrate
.. //depot/projects/arm/src/sys/dev/re/if_re.c#5 integrate
.. //depot/projects/arm/src/sys/dev/usb/if_ural.c#3 integrate
.. //depot/projects/arm/src/sys/fs/smbfs/smbfs_smb.c#3 integrate
.. //depot/projects/arm/src/sys/i386/conf/NOTES#5 integrate
.. //depot/projects/arm/src/sys/i386/i386/apic_vector.s#3 integrate
.. //depot/projects/arm/src/sys/i386/i386/machdep.c#5 integrate
.. //depot/projects/arm/src/sys/i386/i386/mp_machdep.c#3 integrate
.. //depot/projects/arm/src/sys/i386/include/smp.h#3 integrate
.. //depot/projects/arm/src/sys/i386/include/smptests.h#3 delete
.. //depot/projects/arm/src/sys/kern/uipc_socket2.c#6 integrate
.. //depot/projects/arm/src/sys/kern/vfs_mount.c#5 integrate
.. //depot/projects/arm/src/sys/modules/i2c/controllers/pcf/Makefile#3 integrate
.. //depot/projects/arm/src/sys/netsmb/smb_dev.c#3 integrate
.. //depot/projects/arm/src/sys/pc98/include/smptests.h#2 delete
.. //depot/projects/arm/src/sys/pc98/pc98/machdep.c#2 integrate
.. //depot/projects/arm/src/sys/pci/if_de.c#4 integrate
.. //depot/projects/arm/src/sys/pci/if_devar.h#3 integrate
.. //depot/projects/arm/src/sys/sparc64/central/central.c#4 integrate
.. //depot/projects/arm/src/sys/sparc64/conf/DEFAULTS#2 integrate
.. //depot/projects/arm/src/sys/sparc64/ebus/ebus.c#3 integrate
.. //depot/projects/arm/src/sys/sparc64/fhc/fhc.c#4 integrate
.. //depot/projects/arm/src/sys/sparc64/fhc/fhc_central.c#4 integrate
.. //depot/projects/arm/src/sys/sparc64/fhc/fhc_nexus.c#4 integrate
.. //depot/projects/arm/src/sys/sparc64/fhc/fhcvar.h#4 integrate
.. //depot/projects/arm/src/sys/sparc64/pci/ofw_pcibus.c#3 integrate
.. //depot/projects/arm/src/sys/sparc64/pci/psycho.c#2 integrate
.. //depot/projects/arm/src/sys/sparc64/pci/psychoreg.h#2 integrate
.. //depot/projects/arm/src/sys/sparc64/pci/psychovar.h#2 integrate
.. //depot/projects/arm/src/sys/sparc64/sbus/dma_sbus.c#2 integrate
.. //depot/projects/arm/src/sys/sparc64/sbus/sbus.c#3 integrate
.. //depot/projects/arm/src/sys/sys/bio.h#3 integrate
.. //depot/projects/arm/src/sys/sys/event.h#4 integrate
.. //depot/projects/arm/src/sys/sys/queue.h#5 integrate

Differences ...

==== //depot/projects/arm/src/sys/amd64/amd64/machdep.c#6 (text+ko) ====

@@ -39,7 +39,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/amd64/amd64/machdep.c,v 1.644 2005/11/21 18:39:17 jhb Exp $");
+__FBSDID("$FreeBSD: src/sys/amd64/amd64/machdep.c,v 1.645 2005/11/24 08:16:17 ru Exp $");
 
 #include "opt_atalk.h"
 #include "opt_atpic.h"
@@ -343,7 +343,7 @@
 sigreturn(td, uap)
 	struct thread *td;
 	struct sigreturn_args /* {
-		const __ucontext *sigcntxp;
+		const struct __ucontext *sigcntxp;
 	} */ *uap;
 {
 	ucontext_t uc;

==== //depot/projects/arm/src/sys/arm/arm/cpufunc_asm_arm9.S#3 (text+ko) ====

@@ -32,6 +32,7 @@
  */
  
 #include <machine/asm.h>
+__FBSDID("$FreeBSD: src/sys/arm/arm/cpufunc_asm_arm9.S,v 1.4 2005/11/23 18:02:40 cognet Exp $");
 
 /*
  * Functions to set the MMU Translation Table Base register

==== //depot/projects/arm/src/sys/arm/arm/elf_trampoline.c#2 (text+ko) ====

@@ -23,7 +23,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/arm/arm/elf_trampoline.c,v 1.1 2005/10/03 14:09:36 cognet Exp $");
+__FBSDID("$FreeBSD: src/sys/arm/arm/elf_trampoline.c,v 1.2 2005/11/24 02:27:55 cognet Exp $");
 #include <machine/asm.h>
 #include <sys/types.h>
 #include <sys/elf32.h>
@@ -36,6 +36,14 @@
 extern char kernel_start[];
 extern char kernel_end[];
 
+void __start(void);
+
+void
+_start(void)
+{
+	__start();
+}
+
 static __inline void *
 memcpy(void *dst, const void *src, int len)
 {
@@ -168,8 +176,10 @@
 			    phdr[i].p_filesz);
 	}
 	/* Now grab the symbol tables. */
-	*(Elf_Addr *)curaddr = ssym - curaddr + KERNVIRTADDR;
-	*((Elf_Addr *)curaddr + 1) = lastaddr - curaddr + KERNVIRTADDR;
+	*(Elf_Addr *)curaddr = MAGIC_TRAMP_NUMBER;
+	*((Elf_Addr *)curaddr + 1) = ssym - curaddr + KERNVIRTADDR;
+	*((Elf_Addr *)curaddr + 2) = lastaddr - curaddr + KERNVIRTADDR;
+
 	/* Jump to the entry point. */
 	((void(*)(void))(entry_point - KERNVIRTADDR + curaddr))();
 	__asm __volatile(".globl func_end\n"
@@ -179,7 +189,7 @@
 
 extern char func_end[];
 
-int _start(void)
+void __start(void)
 {
 	void *curaddr;
 
@@ -194,5 +204,5 @@
 	((void (*)())dst)((unsigned int)&kernel_start, 
 			  (unsigned int)&kernel_end, (unsigned int)curaddr,
 			  dst + (unsigned int)&func_end - 
-			  (unsigned int)(&load_kernel),1);
+			  (unsigned int)(&load_kernel), 1);
 }

==== //depot/projects/arm/src/sys/arm/arm/machdep.c#5 (text+ko) ====

@@ -44,7 +44,7 @@
 
 #include "opt_compat.h"
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/arm/arm/machdep.c,v 1.19 2005/11/06 16:10:28 cognet Exp $");
+__FBSDID("$FreeBSD: src/sys/arm/arm/machdep.c,v 1.20 2005/11/24 08:16:17 ru Exp $");
 
 #include <sys/param.h>
 #include <sys/proc.h>
@@ -511,7 +511,7 @@
 sigreturn(td, uap)
 	struct thread *td;
 	struct sigreturn_args /* {
-		const __ucontext *sigcntxp;
+		const struct __ucontext *sigcntxp;
 	} */ *uap;
 {
 	struct proc *p = td->td_proc;

==== //depot/projects/arm/src/sys/arm/include/elf.h#2 (text+ko) ====

@@ -24,7 +24,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $FreeBSD: src/sys/arm/include/elf.h,v 1.5 2004/05/04 22:21:36 cognet Exp $
+ * $FreeBSD: src/sys/arm/include/elf.h,v 1.6 2005/11/24 02:27:55 cognet Exp $
  */
 
 #ifndef _MACHINE_ELF_H_
@@ -125,4 +125,9 @@
 #define	ELF_TARG_MACH	EM_ARM
 #define	ELF_TARG_VER	1
 
+/* 
+ * Magic number for the elf trampoline, chosen wisely to be an immediate 
+ * value.
+ */
+#define MAGIC_TRAMP_NUMBER	0x5c000003
 #endif /* !_MACHINE_ELF_H_ */

==== //depot/projects/arm/src/sys/arm/xscale/i80321/iq31244_machdep.c#5 (text+ko) ====

@@ -49,7 +49,7 @@
 #include "opt_ddb.h"
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/arm/xscale/i80321/iq31244_machdep.c,v 1.15 2005/10/04 14:37:03 cognet Exp $");
+__FBSDID("$FreeBSD: src/sys/arm/xscale/i80321/iq31244_machdep.c,v 1.16 2005/11/24 02:27:55 cognet Exp $");
 
 #define _ARM32_BUS_DMA_PRIVATE
 #include <sys/param.h>
@@ -233,16 +233,16 @@
 	fake_preload[i++] = sizeof(uint32_t);
 	fake_preload[i++] = (uint32_t)&end - KERNBASE - 0x00200000;
 #ifdef DDB
-	if (*(uint32_t *)KERNVIRTADDR != 0) {
+	if (*(uint32_t *)KERNVIRTADDR == MAGIC_TRAMP_NUMBER) {
 		fake_preload[i++] = MODINFO_METADATA|MODINFOMD_SSYM;
 		fake_preload[i++] = sizeof(vm_offset_t);
-		fake_preload[i++] = *(uint32_t *)KERNVIRTADDR;
+		fake_preload[i++] = *(uint32_t *)(KERNVIRTADDR + 4);
 		fake_preload[i++] = MODINFO_METADATA|MODINFOMD_ESYM;
 		fake_preload[i++] = sizeof(vm_offset_t);
-		fake_preload[i++] = *(uint32_t *)(KERNVIRTADDR + 4);
-		lastaddr = *(uint32_t *)(KERNVIRTADDR + 4);
+		fake_preload[i++] = *(uint32_t *)(KERNVIRTADDR + 8);
+		lastaddr = *(uint32_t *)(KERNVIRTADDR + 8);
 		zend = lastaddr;
-		zstart = *(uint32_t *)KERNVIRTADDR;
+		zstart = *(uint32_t *)(KERNVIRTADDR + 4);
 		ksym_start = zstart;
 		ksym_end = zend;
 	} else

==== //depot/projects/arm/src/sys/compat/ndis/subr_ntoskrnl.c#6 (text+ko) ====

@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/compat/ndis/subr_ntoskrnl.c,v 1.84 2005/11/20 01:29:29 wpaul Exp $");
+__FBSDID("$FreeBSD: src/sys/compat/ndis/subr_ntoskrnl.c,v 1.85 2005/11/23 17:10:46 wpaul Exp $");
 
 #include <sys/ctype.h>
 #include <sys/unistd.h>
@@ -234,6 +234,7 @@
 static uint32_t WmiTraceMessage(uint64_t, uint32_t, void *, uint16_t, ...);
 static uint32_t IoWMIRegistrationControl(device_object *, uint32_t);
 static void *ntoskrnl_memset(void *, int, size_t);
+static void *ntoskrnl_memmove(void *, void *, size_t);
 static char *ntoskrnl_strstr(char *, char *);
 static int ntoskrnl_toupper(int);
 static int ntoskrnl_tolower(int);
@@ -423,6 +424,16 @@
 	return(memset(buf, ch, size));
 }
 
+static void *
+ntoskrnl_memmove(dst, src, size)
+	void			*src;
+	void			*dst;
+	size_t			size;
+{
+	bcopy(src, dst, size);
+	return(dst);
+}
+
 static char *
 ntoskrnl_strstr(s, find)
 	char *s, *find;
@@ -4142,7 +4153,7 @@
 	IMPORT_CFUNC_MAP(strstr, ntoskrnl_strstr, 0),
 	IMPORT_CFUNC_MAP(strchr, index, 0),
 	IMPORT_CFUNC(memcpy, 0),
-	IMPORT_CFUNC_MAP(memmove, ntoskrnl_memset, 0),
+	IMPORT_CFUNC_MAP(memmove, ntoskrnl_memmove, 0),
 	IMPORT_CFUNC_MAP(memset, ntoskrnl_memset, 0),
 	IMPORT_SFUNC(IoAllocateDriverObjectExtension, 4),
 	IMPORT_SFUNC(IoGetDriverObjectExtension, 2),

==== //depot/projects/arm/src/sys/conf/Makefile.arm#4 (text+ko) ====

@@ -1,7 +1,7 @@
 # Makefile.arm -- with config changes.
 # Copyright 1990 W. Jolitz
 #	from: @(#)Makefile.i386	7.1 5/10/91
-# $FreeBSD: src/sys/conf/Makefile.arm,v 1.17 2005/11/17 01:32:01 cognet Exp $
+# $FreeBSD: src/sys/conf/Makefile.arm,v 1.18 2005/11/24 02:25:49 cognet Exp $
 #
 # Makefile for FreeBSD
 #
@@ -48,6 +48,16 @@
 
 DDB_ENABLED!=	grep DDB opt_ddb.h || true
 
+SYSTEM_LD_ = ${LD} -Bdynamic -T ldscript.$M.static \
+	  -warn-common -export-dynamic -dynamic-linker /red/herring -o \
+	   ${FULLKERNEL}.noheader -X ${SYSTEM_OBJS} vers.o
+SYSTEM_LD_TAIL +=; cat ldscript.$M| \
+		sed s/" + SIZEOF_HEADERS"// \
+		>ldscript.$M.noheader; \
+		${SYSTEM_LD_}; \
+		${OBJCOPY} -S -O binary ${FULLKERNEL}.noheader \
+		${KERNEL_KO}.bin; \
+		rm ${FULLKERNEL}.noheader
 .if ${DDB_ENABLED} != ""
 SYSTEM_LD_TAIL += ;echo "\#define KERNNAME \"${KERNEL_KO}.tmp\"" \
 	>opt_kernname.h ;\
@@ -55,9 +65,17 @@
 	-g --strip-symbol '$$t' ${FULLKERNEL} ${KERNEL_KO}.tmp;\
 	${CC} -O -nostdlib -I. -Xlinker -T -Xlinker ldscript.arm \
 	$S/$M/$M/elf_trampoline.c $S/$M/$M/inckern.S -o ${KERNEL_KO}.tramp;\
-	rm ${KERNEL_KO}.tmp
+	${CC} -O -nostdlib -I. -Xlinker -T -Xlinker ldscript.arm.noheader \
+	$S/$M/$M/elf_trampoline.c $S/$M/$M/inckern.S -o \
+	${KERNEL_KO}.tramp.noheader; \
+	${OBJCOPY} -S -O binary ${KERNEL_KO}.tramp.noheader \
+	${KERNEL_KO}.tramp.bin; \
+	rm ${KERNEL_KO}.tmp ${KERNEL_KO}.tramp.noheader; \
+
 .endif
 
+CLEANFILES +=	ldscript.$M ldscript.$M.static ${KERNEL_KO}.bin \
+		${KERNEL_KO}.tramp ${KERNEL_KO}.tramp.bin
 %BEFORE_DEPEND
 
 %OBJS

==== //depot/projects/arm/src/sys/conf/files#6 (text+ko) ====

@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/conf/files,v 1.1065 2005/11/18 20:12:40 andre Exp $
+# $FreeBSD: src/sys/conf/files,v 1.1066 2005/11/22 17:12:48 marius Exp $
 #
 # The long compile-with and dependency lines are required because of
 # limitations in config: backslash-newline doesn't work in strings, and
@@ -1025,7 +1025,6 @@
 dev/wl/if_wl.c			optional wl isa
 dev/xe/if_xe.c			optional xe
 dev/xe/if_xe_pccard.c		optional xe pccard
-dev/zs/zs.c			optional zs
 fs/deadfs/dead_vnops.c		standard
 fs/devfs/devfs_devs.c		standard
 fs/devfs/devfs_rule.c		standard

==== //depot/projects/arm/src/sys/conf/files.powerpc#3 (text+ko) ====

@@ -1,7 +1,7 @@
 # This file tells config what files go into building a kernel,
 # files marked standard are always included.
 #
-# $FreeBSD: src/sys/conf/files.powerpc,v 1.45 2005/11/08 06:48:08 grehan Exp $
+# $FreeBSD: src/sys/conf/files.powerpc,v 1.47 2005/11/22 17:12:49 marius Exp $
 #
 # The long compile-with and dependency lines are required because of
 # limitations in config: backslash-newline doesn't work in strings, and
@@ -76,6 +76,7 @@
 
 dev/ofw/openfirm.c		standard
 dev/ofw/ofw_bus_if.m		standard
+dev/ofw/ofw_bus_subr.c		standard
 dev/ofw/ofw_console.c		standard
 dev/ofw/ofw_disk.c		optional	ofwd
 
@@ -115,4 +116,5 @@
 powerpc/psim/openpic_iobus.c	optional psim
 powerpc/psim/sio_iobus.c	optional sio psim
 
+dev/zs/zs.c			optional	powermac zs
 dev/zs/zs_macio.c		optional	powermac zs

==== //depot/projects/arm/src/sys/conf/files.sparc64#3 (text+ko) ====

@@ -1,7 +1,7 @@
 # This file tells config what files go into building a kernel,
 # files marked standard are always included.
 #
-# $FreeBSD: src/sys/conf/files.sparc64,v 1.74 2005/10/28 15:58:18 joerg Exp $
+# $FreeBSD: src/sys/conf/files.sparc64,v 1.76 2005/11/22 17:25:10 marius Exp $
 #
 # The long compile-with and dependency lines are required because of
 # limitations in config: backslash-newline doesn't work in strings, and
@@ -42,11 +42,12 @@
 dev/kbd/kbd.c			optional	sc
 dev/kbd/kbd.c			optional	ukbd
 dev/ofw/ofw_bus_if.m		standard
+dev/ofw/ofw_bus_subr.c		standard
 dev/ofw/ofw_console.c		optional	ofw_console
 dev/ofw/openfirm.c		standard
 dev/ofw/openfirmio.c		standard
 dev/ofw/openpromio.c		standard
-dev/pcf/envctrl.c		optional	pcf
+dev/pcf/envctrl.c		optional	pcf ebus
 dev/pcf/pcf_ebus.c		optional	pcf ebus
 dev/sound/sbus/cs4231.c		optional	snd_audiocs ebus
 dev/sound/sbus/cs4231.c		optional	snd_audiocs sbus

==== //depot/projects/arm/src/sys/conf/ldscript.arm#2 (text+ko) ====

@@ -1,4 +1,4 @@
-/* $FreeBSD: src/sys/conf/ldscript.arm,v 1.2 2004/09/23 22:52:55 cognet Exp $ */
+/* $FreeBSD: src/sys/conf/ldscript.arm,v 1.3 2005/11/24 02:25:49 cognet Exp $ */
 OUTPUT_FORMAT("elf32-littlearm", "elf32-bigarm", "elf32-littlearm")
 OUTPUT_ARCH(arm)
 ENTRY(_start)
@@ -8,7 +8,20 @@
 {
   /* Read-only sections, merged into text segment: */
   . = KERNVIRTADDR + SIZEOF_HEADERS;
-  .interp     : { *(.interp) 	}
+  .text      :
+  {
+    *(.text)
+    *(.stub)
+    /* .gnu.warning sections are handled specially by elf32.em.  */
+    *(.gnu.warning)
+    *(.gnu.linkonce.t*)
+  } =0x9090
+  _etext = .;
+  PROVIDE (etext = .);
+  .fini      : { *(.fini)    } =0x9090
+  .rodata    : { *(.rodata) *(.gnu.linkonce.r*) }
+  .rodata1   : { *(.rodata1) }
+   .interp     : { *(.interp) 	}
   .hash          : { *(.hash)		}
   .dynsym        : { *(.dynsym)		}
   .dynstr        : { *(.dynstr)		}
@@ -43,19 +56,7 @@
   .rela.plt      : { *(.rela.plt)		}
   .init          : { *(.init)	} =0x9090
   .plt      : { *(.plt)	}
-  .text      :
-  {
-    *(.text)
-    *(.stub)
-    /* .gnu.warning sections are handled specially by elf32.em.  */
-    *(.gnu.warning)
-    *(.gnu.linkonce.t*)
-  } =0x9090
-  _etext = .;
-  PROVIDE (etext = .);
-  .fini      : { *(.fini)    } =0x9090
-  .rodata    : { *(.rodata) *(.gnu.linkonce.r*) }
-  .rodata1   : { *(.rodata1) }
+
   /* Adjust the address for the data segment.  We want to adjust up to
      the same address within the page on the next page up.  */
   . = ALIGN(0x1000) + (. & (0x1000 - 1)) ; 

==== //depot/projects/arm/src/sys/conf/options#6 (text+ko) ====

@@ -1,4 +1,4 @@
-# $FreeBSD: src/sys/conf/options,v 1.517 2005/10/14 18:24:58 jhb Exp $
+# $FreeBSD: src/sys/conf/options,v 1.518 2005/11/23 18:11:24 jhb Exp $
 #
 #        On the handling of kernel options
 #
@@ -69,7 +69,6 @@
 CY_PCI_FASTINTR
 DIRECTIO	opt_directio.h
 FULL_PREEMPTION	opt_sched.h
-PREEMPTION	opt_sched.h
 IPI_PREEMPTION	opt_sched.h
 GEOM_AES	opt_geom.h
 GEOM_APPLE	opt_geom.h
@@ -120,6 +119,7 @@
 NSWBUF_MIN	opt_swap.h
 PANIC_REBOOT_WAIT_TIME	opt_panic.h
 PPS_SYNC	opt_ntp.h
+PREEMPTION	opt_sched.h
 PUC_FASTINTR	opt_puc.h
 QUOTA
 SCHED_4BSD	opt_sched.h

==== //depot/projects/arm/src/sys/conf/options.i386#4 (text+ko) ====

@@ -1,20 +1,22 @@
-# $FreeBSD: src/sys/conf/options.i386,v 1.227 2005/11/09 03:55:39 imp Exp $
+# $FreeBSD: src/sys/conf/options.i386,v 1.229 2005/11/23 18:11:24 jhb Exp $
 # Options specific to the i386 platform kernels
 
 AUTO_EOI_1		opt_auto_eoi.h
 AUTO_EOI_2		opt_auto_eoi.h
 BROKEN_KEYBOARD_RESET	opt_reset.h
+COUNT_XINVLTLB_HITS	opt_smp.h
+COUNT_IPIS		opt_smp.h
 DISABLE_PG_G		opt_pmap.h
 DISABLE_PSE		opt_pmap.h
 I586_PMC_GUPROF		opt_i586_guprof.h
 MAXMEM
 MPTABLE_FORCE_HTT
+MP_WATCHDOG		opt_mp_watchdog.h
 PERFMON
 PMAP_SHPGPERPROC	opt_pmap.h
 POWERFAIL_NMI		opt_trap.h
 PPC_DEBUG		opt_ppc.h
 PPC_PROBE_CHIPSET	opt_ppc.h
-MP_WATCHDOG		opt_mp_watchdog.h
 
 # Options for emulators.  These should only be used at config time, so
 # they are handled like options for static filesystems
@@ -161,8 +163,8 @@
 ASR_COMPAT		opt_asr.h
 
 # Debugging
+NPX_DEBUG		opt_npx.h
 STOP_NMI		opt_cpu.h
-NPX_DEBUG		opt_npx.h
 
 # XBOX support in the kernel
 XBOX			opt_xbox.h

==== //depot/projects/arm/src/sys/conf/options.pc98#3 (text+ko) ====

@@ -1,19 +1,21 @@
-# $FreeBSD: src/sys/conf/options.pc98,v 1.192 2005/11/14 01:25:05 imp Exp $
+# $FreeBSD: src/sys/conf/options.pc98,v 1.193 2005/11/23 18:12:05 jhb Exp $
 # Options specific to the pc98 platform kernels
 
 AUTO_EOI_1		opt_auto_eoi.h
 BROKEN_KEYBOARD_RESET	opt_reset.h
+COUNT_XINVLTLB_HITS	opt_smp.h
+COUNT_IPIS		opt_smp.h
 DISABLE_PG_G		opt_pmap.h
 DISABLE_PSE		opt_pmap.h
 I586_PMC_GUPROF		opt_i586_guprof.h
 MAXMEM
 MPTABLE_FORCE_HTT
+MP_WATCHDOG		opt_mp_watchdog.h
 PERFMON
 PMAP_SHPGPERPROC	opt_pmap.h
 POWERFAIL_NMI		opt_trap.h
 PPC_DEBUG		opt_ppc.h
 PPC_PROBE_CHIPSET	opt_ppc.h
-MP_WATCHDOG		opt_mp_watchdog.h
 
 # Options for emulators.  These should only be used at config time, so
 # they are handled like options for static filesystems
@@ -103,8 +105,8 @@
 DEV_NPX			opt_npx.h
 
 # Debugging
+NPX_DEBUG		opt_npx.h
 STOP_NMI		opt_cpu.h
-NPX_DEBUG		opt_npx.h
 
 # FreeBSD/i386 supports xbox and is shared with pc98 so we need to define
 # dummy opt_xbox.h

==== //depot/projects/arm/src/sys/dev/acpica/acpi_battery.c#4 (text+ko) ====

@@ -26,7 +26,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_battery.c,v 1.21 2005/10/23 19:31:18 njl Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_battery.c,v 1.22 2005/11/23 00:53:01 njl Exp $");
 
 #include "opt_acpi.h"
 #include <sys/param.h>
@@ -101,21 +101,15 @@
 int
 acpi_battery_bst_valid(struct acpi_bst *bst)
 {
-    if (bst->state >= ACPI_BATT_STAT_MAX || bst->cap == ACPI_BATT_UNKNOWN ||
-	bst->volt == ACPI_BATT_UNKNOWN)
-	return (FALSE);
-    else
-	return (TRUE);
+    return (bst->state < ACPI_BATT_STAT_MAX && bst->cap != ACPI_BATT_UNKNOWN &&
+	bst->volt != ACPI_BATT_UNKNOWN);
 }
 
 /* Check _BIF results for validity. */
 int
 acpi_battery_bif_valid(struct acpi_bif *bif)
 {
-    if (bif->lfcap == 0)
-	return (FALSE);
-    else
-	return (TRUE);
+    return (bif->lfcap != 0);
 }
 
 /* Get info about one or all batteries. */

==== //depot/projects/arm/src/sys/dev/acpica/acpi_cmbat.c#3 (text+ko) ====

@@ -28,7 +28,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_cmbat.c,v 1.41 2005/09/11 18:39:01 obrien Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_cmbat.c,v 1.42 2005/11/23 00:57:51 njl Exp $");
 
 #include "opt_acpi.h"
 #include <sys/param.h>
@@ -66,7 +66,6 @@
 
     struct acpi_bif bif;
     struct acpi_bst bst;
-    struct timespec bif_lastupdated;
     struct timespec bst_lastupdated;
 };
 
@@ -80,8 +79,8 @@
 			    void *context);
 static int		acpi_cmbat_info_expired(struct timespec *lastupdated);
 static void		acpi_cmbat_info_updated(struct timespec *lastupdated);
-static void		acpi_cmbat_get_bst(device_t dev);
-static void		acpi_cmbat_get_bif(device_t dev);
+static void		acpi_cmbat_get_bst(void *arg);
+static void		acpi_cmbat_get_bif(void *arg);
 static int		acpi_cmbat_bst(device_t dev, struct acpi_bst *bstp);
 static int		acpi_cmbat_bif(device_t dev, struct acpi_bif *bifp);
 static void		acpi_cmbat_init_battery(void *arg);
@@ -134,7 +133,6 @@
     handle = acpi_get_handle(dev);
     sc->dev = dev;
 
-    timespecclear(&sc->bif_lastupdated);
     timespecclear(&sc->bst_lastupdated);
 
     error = acpi_battery_register(dev);
@@ -180,20 +178,22 @@
     dev = (device_t)context;
     sc = device_get_softc(dev);
 
-    /*
-     * Clear the appropriate last updated time.  The next call to retrieve
-     * the battery status will get the new value for us.  We don't need to
-     * acquire a lock since we are only clearing the time stamp and since
-     * calling _BST/_BIF can trigger a notify, we could deadlock also.
-     */
     switch (notify) {
     case ACPI_NOTIFY_DEVICE_CHECK:
     case ACPI_BATTERY_BST_CHANGE:
+	/*
+	 * Clear the last updated time.  The next call to retrieve the
+	 * battery status will get the new value for us.
+	 */
 	timespecclear(&sc->bst_lastupdated);
 	break;
     case ACPI_NOTIFY_BUS_CHECK:
     case ACPI_BATTERY_BIF_CHANGE:
-	timespecclear(&sc->bif_lastupdated);
+	/*
+	 * Queue a callback to get the current battery info from thread
+	 * context.  It's not safe to block in a notify handler.
+	 */
+	AcpiOsQueueForExecution(OSD_PRIORITY_LO, acpi_cmbat_get_bif, dev);
 	break;
     }
 
@@ -229,16 +229,18 @@
 }
 
 static void
-acpi_cmbat_get_bst(device_t dev)
+acpi_cmbat_get_bst(void *arg)
 {
     struct acpi_cmbat_softc *sc;
     ACPI_STATUS	as;
     ACPI_OBJECT	*res;
     ACPI_HANDLE	h;
     ACPI_BUFFER	bst_buffer;
+    device_t dev;
 
     ACPI_SERIAL_ASSERT(cmbat);
 
+    dev = arg;
     sc = device_get_softc(dev);
     h = acpi_get_handle(dev);
     bst_buffer.Pointer = NULL;
@@ -287,24 +289,23 @@
 }
 
 static void
-acpi_cmbat_get_bif(device_t dev)
+acpi_cmbat_get_bif(void *arg)
 {
     struct acpi_cmbat_softc *sc;
     ACPI_STATUS	as;
     ACPI_OBJECT	*res;
     ACPI_HANDLE	h;
     ACPI_BUFFER	bif_buffer;
+    device_t dev;
 
     ACPI_SERIAL_ASSERT(cmbat);
 
+    dev = arg;
     sc = device_get_softc(dev);
     h = acpi_get_handle(dev);
     bif_buffer.Pointer = NULL;
     bif_buffer.Length = ACPI_ALLOCATE_BUFFER;
 
-    if (!acpi_cmbat_info_expired(&sc->bif_lastupdated))
-	goto end;
-
     as = AcpiEvaluateObject(h, "_BIF", NULL, &bif_buffer);
     if (ACPI_FAILURE(as)) {
 	ACPI_VPRINT(dev, acpi_device_get_parent_softc(dev),
@@ -346,7 +347,6 @@
 	goto end;
     if (acpi_PkgStr(res, 12, sc->bif.oeminfo, ACPI_CMBAT_MAXSTRLEN) != 0)
 	goto end;
-    acpi_cmbat_info_updated(&sc->bif_lastupdated);
 
 end:
     if (bif_buffer.Pointer != NULL)
@@ -360,8 +360,13 @@
 
     sc = device_get_softc(dev);
 
+    /*
+     * Just copy the data.  The only value that should change is the
+     * last-full capacity, so we only update when we get a notify that says
+     * the info has changed.  Many systems apparently take a long time to
+     * process a _BIF call so we avoid it if possible.
+     */
     ACPI_SERIAL_BEGIN(cmbat);
-    acpi_cmbat_get_bif(dev);
     bifp->units = sc->bif.units;
     bifp->dcap = sc->bif.dcap;
     bifp->lfcap = sc->bif.lfcap;
@@ -422,11 +427,18 @@
 	if (!acpi_BatteryIsPresent(dev))
 	    continue;
 
+	/*
+	 * Only query the battery if this is the first try or the specific
+	 * type of info is still invalid.
+	 */
 	ACPI_SERIAL_BEGIN(cmbat);
-	timespecclear(&sc->bst_lastupdated);
-	timespecclear(&sc->bif_lastupdated);
-	acpi_cmbat_get_bst(dev);
-	acpi_cmbat_get_bif(dev);
+	if (retry == 0 || !acpi_battery_bst_valid(&sc->bst)) {
+	    timespecclear(&sc->bst_lastupdated);
+	    acpi_cmbat_get_bst(dev);
+	}
+	if (retry == 0 || !acpi_battery_bif_valid(&sc->bif))
+	    acpi_cmbat_get_bif(dev);
+
 	valid = acpi_battery_bst_valid(&sc->bst) &&
 	    acpi_battery_bif_valid(&sc->bif);
 	ACPI_SERIAL_END(cmbat);

==== //depot/projects/arm/src/sys/dev/acpica/acpi_pci_link.c#3 (text+ko) ====

@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_pci_link.c,v 1.48 2005/11/01 22:44:07 jkim Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_pci_link.c,v 1.50 2005/11/23 16:36:13 jhb Exp $");
 
 #include "opt_acpi.h"
 #include <sys/param.h>
@@ -159,6 +159,7 @@
 		device_set_desc_copy(dev, descr);
 	} else
 		device_set_desc(dev, "ACPI PCI Link");
+	device_quiet(dev);
 	return (0);
 }
 
@@ -608,7 +609,19 @@
 {
 	struct link *link;
 	uint8_t bios_irq;
+	uintptr_t bus;
 
+	/*
+	 * Look up the PCI bus for the specified PCI bridge device.  Note
+	 * that the PCI bridge device might not have any children yet.
+	 * However, looking up its bus number doesn't require a valid child
+	 * device, so we just pass NULL.
+	 */
+	if (BUS_READ_IVAR(pcib, NULL, PCIB_IVAR_BUS, &bus) != 0) {
+		device_printf(pcib, "Unable to read PCI bus number");
+		panic("PCI bridge without a bus number");
+	}
+		
 	/* Bump the reference count. */
 	ACPI_SERIAL_BEGIN(pci_link);
 	link = acpi_pci_link_lookup(dev, index);
@@ -618,8 +631,28 @@
 	if (link->l_routed)
 		pci_link_interrupt_weights[link->l_irq]++;
 
+	/*
+	 * The BIOS only routes interrupts via ISA IRQs using the ATPICs
+	 * (8259As).  Thus, if this link is routed via an ISA IRQ, go
+	 * look to see if the BIOS routed an IRQ for this link at the
+	 * indicated (bus, slot, pin).  If so, we prefer that IRQ for
+	 * this link and add that IRQ to our list of known-good IRQs.
+	 * This provides a good work-around for link devices whose _CRS
+	 * method is either broken or bogus.  We only use the value
+	 * returned by _CRS if we can't find a valid IRQ via this method
+	 * in fact.
+	 *
+	 * If this link is not routed via an ISA IRQ (because we are using
+	 * APIC for example), then don't bother looking up the BIOS IRQ
+	 * as if we find one it won't be valid anyway.
+	 */
+	if (!link->l_isa_irq) {
+		ACPI_SERIAL_END(pci_link);
+		return;
+	}
+
 	/* Try to find a BIOS IRQ setting from any matching devices. */
-	bios_irq = acpi_pci_link_search_irq(pcib_get_bus(pcib), slot, pin);
+	bios_irq = acpi_pci_link_search_irq(bus, slot, pin);
 	if (!PCI_INTERRUPT_VALID(bios_irq)) {
 		ACPI_SERIAL_END(pci_link);
 		return;
@@ -628,7 +661,7 @@
 	/* Validate the BIOS IRQ. */
 	if (!link_valid_irq(link, bios_irq)) {
 		device_printf(dev, "BIOS IRQ %u for %d.%d.INT%c is invalid\n",
-		    bios_irq, pcib_get_bus(pcib), slot, pin + 'A');
+		    bios_irq, (int)bus, slot, pin + 'A');
 	} else if (!PCI_INTERRUPT_VALID(link->l_bios_irq)) {
 		link->l_bios_irq = bios_irq;
 		if (bios_irq < NUM_ISA_INTERRUPTS)
@@ -641,7 +674,7 @@
 	} else if (bios_irq != link->l_bios_irq)
 		device_printf(dev,
 	    "BIOS IRQ %u for %d.%d.INT%c does not match previous BIOS IRQ %u\n",
-		    bios_irq, pcib_get_bus(pcib), slot, pin + 'A',
+		    bios_irq, (int)bus, slot, pin + 'A',
 		    link->l_bios_irq);
 	ACPI_SERIAL_END(pci_link);
 }

==== //depot/projects/arm/src/sys/dev/acpica/acpi_smbat.c#2 (text+ko) ====

@@ -25,7 +25,7 @@
  */
 
 #include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_smbat.c,v 1.1 2005/10/23 00:20:13 njl Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/acpica/acpi_smbat.c,v 1.3 2005/11/24 05:23:56 njl Exp $");
 
 #include "opt_acpi.h"
 #include <sys/param.h>
@@ -44,11 +44,18 @@
 struct acpi_smbat_softc {
 	uint8_t		sb_base_addr;
 	device_t	ec_dev;
+
+	struct acpi_bif	bif;
+	struct acpi_bst	bst;
+	struct timespec	bif_lastupdated;
+	struct timespec	bst_lastupdated;
 };
 
 static int	acpi_smbat_probe(device_t dev);
 static int	acpi_smbat_attach(device_t dev);
 static int	acpi_smbat_shutdown(device_t dev);
+static int	acpi_smbat_info_expired(struct timespec *lastupdated);
+static void	acpi_smbat_info_updated(struct timespec *lastupdated);
 static int	acpi_smbat_get_bif(device_t dev, struct acpi_bif *bif);
 static int	acpi_smbat_get_bst(device_t dev, struct acpi_bst *bst);
 
@@ -114,6 +121,9 @@
 		return (ENXIO);
 	}
 
+	timespecclear(&sc->bif_lastupdated);
+	timespecclear(&sc->bst_lastupdated);
+
 	if (acpi_battery_register(dev) != 0) {
 		device_printf(dev, "cannot register battery\n");
 		return (ENXIO);
@@ -132,6 +142,34 @@
 }
 
 static int
+acpi_smbat_info_expired(struct timespec *lastupdated)
+{
+	struct timespec	curtime;
+
+	ACPI_SERIAL_ASSERT(smbat);
+
+	if (lastupdated == NULL)
+		return (TRUE);
+	if (!timespecisset(lastupdated))
+		return (TRUE);
+
+	getnanotime(&curtime);
+	timespecsub(&curtime, lastupdated);
+	return (curtime.tv_sec < 0 ||
+	    curtime.tv_sec > acpi_battery_get_info_expire());
+}
+
+static void
+acpi_smbat_info_updated(struct timespec *lastupdated)
+{
+
+	ACPI_SERIAL_ASSERT(smbat);
+
+	if (lastupdated != NULL)
+		getnanotime(lastupdated);
+}
+
+static int
 acpi_smbus_read_2(struct acpi_smbat_softc *sc, uint8_t addr, uint8_t cmd,
     uint16_t *ptr)
 {
@@ -284,6 +322,11 @@
 	error = ENXIO;
 	sc = device_get_softc(dev);
 
+	if (!acpi_smbat_info_expired(&sc->bst_lastupdated)) {
+		error = 0;
+		goto out;
+	}
+
 	if (acpi_smbus_read_2(sc, addr, SMBATT_CMD_BATTERY_MODE, &val))
 		goto out;
 	if (val & SMBATT_BM_CAPACITY_MODE) {
@@ -299,7 +342,7 @@
 		goto out;
 
 	if (val & SMBATT_BS_DISCHARGING) {
-		bst->state |= ACPI_BATT_STAT_DISCHARG;
+		sc->bst.state |= ACPI_BATT_STAT_DISCHARG;
 
 		/*
 		 * If the rate is negative, it is discharging.  Otherwise,
@@ -308,27 +351,31 @@
 		if (acpi_smbus_read_2(sc, addr, SMBATT_CMD_AT_RATE, &val))
 			goto out;
 		if (val < 0)
-			bst->rate = (-val) * factor;
+			sc->bst.rate = (-val) * factor;
 		else
-			bst->rate = -1;
+			sc->bst.rate = -1;
 	} else {
-		bst->state |= ACPI_BATT_STAT_CHARGING;
-		bst->rate = -1;
+		sc->bst.state |= ACPI_BATT_STAT_CHARGING;
+		sc->bst.rate = -1;
 	}
 
 	if (val & SMBATT_BS_REMAINING_CAPACITY_ALARM)
-		bst->state |= ACPI_BATT_STAT_CRITICAL;
+		sc->bst.state |= ACPI_BATT_STAT_CRITICAL;
 
 	if (acpi_smbus_read_2(sc, addr, SMBATT_CMD_REMAINING_CAPACITY, &val))
 		goto out;
-	bst->cap = val * factor;
+	sc->bst.cap = val * factor;
 
 	if (acpi_smbus_read_2(sc, addr, SMBATT_CMD_VOLTAGE, &val))
 		goto out;
-	bst->volt = val;
+	sc->bst.volt = val;
+
+	acpi_smbat_info_updated(&sc->bst_lastupdated);
 	error = 0;
 
 out:
+	if (error == 0)
+		memcpy(bst, &sc->bst, sizeof(sc->bst));
 	ACPI_SERIAL_END(smbat);
 	return (error);
 }
@@ -348,55 +395,64 @@
 	error = ENXIO;
 	sc = device_get_softc(dev);
 
+	if (!acpi_smbat_info_expired(&sc->bif_lastupdated)) {
+		error = 0;
+		goto out;
+	}
+
 	if (acpi_smbus_read_2(sc, addr, SMBATT_CMD_BATTERY_MODE, &val))
 		goto out;
 	if (val & SMBATT_BM_CAPACITY_MODE) {
 		factor = 10;
-		bif->units = ACPI_BIF_UNITS_MW;
+		sc->bif.units = ACPI_BIF_UNITS_MW;
 	} else {
 		factor = 1;
-		bif->units = ACPI_BIF_UNITS_MA;
+		sc->bif.units = ACPI_BIF_UNITS_MA;
 	}
 
 	if (acpi_smbus_read_2(sc, addr, SMBATT_CMD_DESIGN_CAPACITY, &val))

>>> TRUNCATED FOR MAIL (1000 lines) <<<


More information about the p4-projects mailing list