Date: Fri, 21 Apr 2006 16:22:07 GMT From: Marcel Moolenaar <marcel@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 95804 for review Message-ID: <200604211622.k3LGM790014452@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=95804 Change 95804 by marcel@marcel_nfs on 2006/04/21 16:22:04 IFC @95803 Affected files ... .. //depot/projects/uart/amd64/amd64/dump_machdep.c#4 integrate .. //depot/projects/uart/amd64/amd64/minidump_machdep.c#1 branch .. //depot/projects/uart/amd64/amd64/pmap.c#33 integrate .. //depot/projects/uart/amd64/amd64/uma_machdep.c#2 integrate .. //depot/projects/uart/amd64/include/md_var.h#6 integrate .. //depot/projects/uart/amd64/include/minidump.h#1 branch .. //depot/projects/uart/boot/arm/at91/Makefile#2 integrate .. //depot/projects/uart/boot/arm/at91/Makefile.inc#2 integrate .. //depot/projects/uart/boot/arm/at91/boot0/main.c#3 integrate .. //depot/projects/uart/boot/arm/at91/boot0iic/Makefile#1 branch .. //depot/projects/uart/boot/arm/at91/boot0iic/doit.c#1 branch .. //depot/projects/uart/boot/arm/at91/boot0iic/main.c#1 branch .. //depot/projects/uart/boot/arm/at91/boot0spi/Makefile#1 branch .. //depot/projects/uart/boot/arm/at91/boot0spi/doit.c#1 branch .. //depot/projects/uart/boot/arm/at91/boot0spi/main.c#1 branch .. //depot/projects/uart/boot/arm/at91/bootiic/Makefile#2 integrate .. //depot/projects/uart/boot/arm/at91/bootiic/arm_init.S#1 branch .. //depot/projects/uart/boot/arm/at91/bootiic/arm_init.s#2 delete .. //depot/projects/uart/boot/arm/at91/bootiic/main.c#2 integrate .. //depot/projects/uart/boot/arm/at91/libat91/Makefile#2 integrate .. //depot/projects/uart/boot/arm/at91/libat91/at91rm9200_lowlevel.c#2 integrate .. //depot/projects/uart/boot/arm/at91/libat91/getc.c#2 integrate .. //depot/projects/uart/boot/arm/at91/libat91/loader_prompt.c#2 integrate .. //depot/projects/uart/boot/arm/at91/libat91/tag_list.c#2 integrate .. //depot/projects/uart/boot/arm/at91/libat91/tag_list.h#2 integrate .. //depot/projects/uart/conf/files.amd64#19 integrate .. //depot/projects/uart/conf/files.i386#24 integrate .. //depot/projects/uart/conf/files.pc98#21 integrate .. //depot/projects/uart/i386/i386/dump_machdep.c#4 integrate .. //depot/projects/uart/i386/i386/minidump_machdep.c#1 branch .. //depot/projects/uart/i386/include/md_var.h#8 integrate .. //depot/projects/uart/i386/include/minidump.h#1 branch .. //depot/projects/uart/ia64/ia64/nexus.c#8 integrate .. //depot/projects/uart/kern/kern_mbuf.c#10 integrate .. //depot/projects/uart/kern/uipc_domain.c#9 integrate .. //depot/projects/uart/kern/uipc_socket2.c#12 integrate .. //depot/projects/uart/kern/uipc_usrreq.c#12 integrate .. //depot/projects/uart/netinet/ip_divert.c#12 integrate .. //depot/projects/uart/netinet/ip_input.c#15 integrate .. //depot/projects/uart/netinet/raw_ip.c#15 integrate .. //depot/projects/uart/netinet/tcp_input.c#23 integrate .. //depot/projects/uart/netinet/tcp_subr.c#19 integrate .. //depot/projects/uart/netinet/udp_usrreq.c#15 integrate .. //depot/projects/uart/netinet6/frag6.c#7 integrate .. //depot/projects/uart/pc98/include/minidump.h#1 branch .. //depot/projects/uart/pc98/pc98/machdep.c#7 integrate .. //depot/projects/uart/sys/eventhandler.h#4 integrate .. //depot/projects/uart/ufs/ffs/ffs_vfsops.c#20 integrate .. //depot/projects/uart/vm/vm_mmap.c#14 integrate .. //depot/projects/uart/vm/vm_page.c#20 integrate Differences ... ==== //depot/projects/uart/amd64/amd64/dump_machdep.c#4 (text+ko) ==== @@ -25,12 +25,13 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/amd64/amd64/dump_machdep.c,v 1.11 2005/07/02 19:57:30 marcel Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/dump_machdep.c,v 1.12 2006/04/21 04:24:50 peter Exp $"); #include <sys/param.h> #include <sys/systm.h> #include <sys/conf.h> #include <sys/cons.h> +#include <sys/sysctl.h> #include <sys/kernel.h> #include <sys/kerneldump.h> #include <vm/vm.h> @@ -40,6 +41,11 @@ CTASSERT(sizeof(struct kerneldumpheader) == 512); +int do_minidump = 1; +TUNABLE_INT("debug.minidump", &do_minidump); +SYSCTL_INT(_debug, OID_AUTO, minidump, CTLFLAG_RW, &do_minidump, 0, + "Enable mini crash dumps"); + /* * Don't touch the first SIZEOF_METADATA bytes on the dump device. This * is to protect us from metadata and to protect metadata from us. @@ -272,6 +278,10 @@ size_t hdrsz; int error; + if (do_minidump) { + minidumpsys(di); + return; + } bzero(&ehdr, sizeof(ehdr)); ehdr.e_ident[EI_MAG0] = ELFMAG0; ehdr.e_ident[EI_MAG1] = ELFMAG1; ==== //depot/projects/uart/amd64/amd64/pmap.c#33 (text+ko) ==== @@ -77,7 +77,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/amd64/amd64/pmap.c,v 1.547 2006/04/18 20:17:32 peter Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/pmap.c,v 1.549 2006/04/21 04:50:18 peter Exp $"); /* * Manages physical address maps. @@ -181,7 +181,7 @@ static u_int64_t KPTphys; /* phys addr of kernel level 1 */ static u_int64_t KPDphys; /* phys addr of kernel level 2 */ -static u_int64_t KPDPphys; /* phys addr of kernel level 3 */ +u_int64_t KPDPphys; /* phys addr of kernel level 3 */ u_int64_t KPML4phys; /* phys addr of kernel level 4 */ static u_int64_t DMPDphys; /* phys addr of direct mapped level 2 */ @@ -1565,6 +1565,7 @@ /* entire chunk is free, return it */ TAILQ_REMOVE(&pmap->pm_pvchunk, pc, pc_list); m = PHYS_TO_VM_PAGE(DMAP_TO_PHYS((vm_offset_t)pc)); + dump_drop_page(m->phys_addr); vm_page_lock_queues(); vm_page_free(m); vm_page_unlock_queues(); @@ -1645,6 +1646,7 @@ PV_STAT(pc_chunk_count++); PV_STAT(pc_chunk_allocs++); colour++; + dump_add_page(m->phys_addr); pc = (void *)PHYS_TO_DMAP(m->phys_addr); pc->pc_pmap = pmap; pc->pc_map[0] = PC_FREE0 & ~1ul; /* preallocated bit 0 */ @@ -2794,6 +2796,7 @@ PV_STAT(pc_chunk_frees++); TAILQ_REMOVE(&pmap->pm_pvchunk, pc, pc_list); m = PHYS_TO_VM_PAGE(DMAP_TO_PHYS((vm_offset_t)pc)); + dump_drop_page(m->phys_addr); vm_page_lock_queues(); vm_page_free(m); vm_page_unlock_queues(); ==== //depot/projects/uart/amd64/amd64/uma_machdep.c#2 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/amd64/amd64/uma_machdep.c,v 1.1 2003/10/14 05:51:31 alc Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/amd64/uma_machdep.c,v 1.2 2006/04/21 04:24:50 peter Exp $"); #include <sys/param.h> #include <sys/lock.h> @@ -44,6 +44,7 @@ { static vm_pindex_t colour; vm_page_t m; + vm_paddr_t pa; void *va; int pflags; @@ -64,7 +65,9 @@ } else break; } - va = (void *)PHYS_TO_DMAP(m->phys_addr); + pa = m->phys_addr; + dump_add_page(pa); + va = (void *)PHYS_TO_DMAP(pa); if ((wait & M_ZERO) && (m->flags & PG_ZERO) == 0) pagezero(va); return (va); @@ -74,8 +77,11 @@ uma_small_free(void *mem, int size, u_int8_t flags) { vm_page_t m; + vm_paddr_t pa; - m = PHYS_TO_VM_PAGE(DMAP_TO_PHYS((vm_offset_t)mem)); + pa = DMAP_TO_PHYS((vm_offset_t)mem); + dump_drop_page(pa); + m = PHYS_TO_VM_PAGE(pa); vm_page_lock_queues(); vm_page_free(m); vm_page_unlock_queues(); ==== //depot/projects/uart/amd64/include/md_var.h#6 (text+ko) ==== @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/amd64/include/md_var.h,v 1.76 2005/10/14 22:52:00 jkim Exp $ + * $FreeBSD: src/sys/amd64/include/md_var.h,v 1.77 2006/04/21 04:24:50 peter Exp $ */ #ifndef _MACHINE_MD_VAR_H_ @@ -53,6 +53,8 @@ extern char kstack[]; extern char sigcode[]; extern int szsigcode; +extern uint64_t *vm_page_dump; +extern int vm_page_dump_size; extern struct pcpu __pcpu[]; @@ -61,11 +63,14 @@ struct reg; struct fpreg; struct dbreg; +struct dumperinfo; void busdma_swi(void); void cpu_setregs(void); void doreti_iret(void) __asm(__STRING(doreti_iret)); void doreti_iret_fault(void) __asm(__STRING(doreti_iret_fault)); +void dump_add_page(vm_paddr_t); +void dump_drop_page(vm_paddr_t); void initializecpu(void); void fillw(int /*u_short*/ pat, void *base, size_t cnt); void fpstate_drop(struct thread *td); @@ -75,5 +80,6 @@ void pagezero(void *addr); void setidt(int idx, alias_for_inthand_t *func, int typ, int dpl, int ist); int user_dbreg_trap(void); +void minidumpsys(struct dumperinfo *); #endif /* !_MACHINE_MD_VAR_H_ */ ==== //depot/projects/uart/boot/arm/at91/Makefile#2 (text) ==== @@ -1,5 +1,5 @@ -# $FreeBSD: src/sys/boot/arm/at91/Makefile,v 1.1 2006/04/19 17:16:48 imp Exp $ +# $FreeBSD: src/sys/boot/arm/at91/Makefile,v 1.2 2006/04/21 06:43:32 imp Exp $ -SUBDIR= libat91 boot0 bootiic bootspi +SUBDIR= libat91 boot0 boot0iic boot0spi bootiic bootspi .include <bsd.subdir.mk> ==== //depot/projects/uart/boot/arm/at91/Makefile.inc#2 (text) ==== @@ -1,4 +1,7 @@ -# $FreeBSD: src/sys/boot/arm/at91/Makefile.inc,v 1.1 2006/04/19 17:16:48 imp Exp $ +# $FreeBSD: src/sys/boot/arm/at91/Makefile.inc,v 1.2 2006/04/21 07:41:36 imp Exp $ + +.if !target(__at91_boot_Makefile.inc__) +__at91_boot_Makefile.inc__: CFLAGS=-O2 -mcpu=arm9 -ffreestanding \ -I${.CURDIR}/../libat91 \ @@ -7,17 +10,27 @@ -Wpointer-arith -Wshadow -Wstrict-prototypes -Wwrite-strings \ -Werror -CFLAGS+=-DBOOT_TSC -#CFLAGS+=-DBOOT_KB920X +#CFLAGS+=-DBOOT_TSC +CFLAGS+=-DBOOT_KB9202 LIBAT91=${.OBJDIR}/../libat91/libat91.a .if defined(P) ${P}: ${P}.out objcopy -S -O binary ${P}.out ${.TARGET} + @set -- `ls -l ${.TARGET}`; x=$$((8192-$$5)); \ + echo "$$x bytes available"; test $$x -ge 0 ${P}.out: ${OBJS} ld ${LDFLAGS} -o ${.TARGET} ${OBJS} ${LIBAT91} CLEANFILES+= ${P} ${P}.out .endif + +.if defined(WITH_TAG_LIST) +MK_TAG_LIST:=yes +.else +MK_TAG_LIST:=no +.endif + +.endif ==== //depot/projects/uart/boot/arm/at91/boot0/main.c#3 (text) ==== @@ -21,14 +21,14 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/boot/arm/at91/boot0/main.c,v 1.3 2006/04/19 17:16:48 imp Exp $ + * $FreeBSD: src/sys/boot/arm/at91/boot0/main.c,v 1.4 2006/04/21 07:45:57 imp Exp $ */ #include "at91rm9200.h" #include "lib.h" #include "at91rm9200_lowlevel.h" -typedef void fn_t(void); +typedef void fn_t(void); int main(void) @@ -39,5 +39,5 @@ while (xmodem_rx(addr) == -1) continue; fn(); - return (1); + return (0); } ==== //depot/projects/uart/boot/arm/at91/bootiic/Makefile#2 (text) ==== @@ -1,8 +1,8 @@ -# $FreeBSD: src/sys/boot/arm/at91/bootiic/Makefile,v 1.1 2006/04/19 17:16:48 imp Exp $ +# $FreeBSD: src/sys/boot/arm/at91/bootiic/Makefile,v 1.2 2006/04/21 13:40:26 imp Exp $ P=bootiic FILES=${P} -SRCS=arm_init.s main.c +SRCS=arm_init.S main.c NO_MAN= LDFLAGS=-e 0 -T ${.CURDIR}/../linker.cfg OBJS+= ${SRCS:N*.h:R:S/$/.o/g} ==== //depot/projects/uart/boot/arm/at91/bootiic/main.c#2 (text) ==== @@ -19,7 +19,7 @@ * only. * END_BLOCK * - * $FreeBSD: src/sys/boot/arm/at91/bootiic/main.c,v 1.1 2006/04/19 17:16:48 imp Exp $ + * $FreeBSD: src/sys/boot/arm/at91/bootiic/main.c,v 1.2 2006/04/21 13:44:58 imp Exp $ ******************************************************************************/ #include "env_vars.h" @@ -27,6 +27,7 @@ #include "loader_prompt.h" #include "emac.h" #include "lib.h" +#include "eeprom.h" /* * .KB_C_FN_DEFINITION_START @@ -41,16 +42,12 @@ int main(void) { - + InitEEPROM(); EMAC_Init(); - LoadBootCommands(); - printf("\n\rKB9202(www.kwikbyte.com)\n\rAuto boot..\n\r"); - if (getc(1) == -1) ExecuteEnvironmentFunctions(); - Bootloader(0); return (1); ==== //depot/projects/uart/boot/arm/at91/libat91/Makefile#2 (text) ==== @@ -1,4 +1,6 @@ -# $FreeBSD: src/sys/boot/arm/at91/libat91/Makefile,v 1.1 2006/04/19 17:16:49 imp Exp $ +# $FreeBSD: src/sys/boot/arm/at91/libat91/Makefile,v 1.2 2006/04/21 13:51:47 imp Exp $ + +.include "${.CURDIR}/../Makefile.inc" LIB= at91 INTERNALLIB= @@ -6,4 +8,9 @@ p_string.c putchar.c printf.c xmodem.c NO_MAN= +.if ${MK_TAG_LIST} != "no" +CFLAGS += -I${.CURDIR}/.. -DSUPPORT_TAG_LIST +SRCS+=tag_list.c +.endif + .include <bsd.lib.mk> ==== //depot/projects/uart/boot/arm/at91/libat91/at91rm9200_lowlevel.c#2 (text) ==== @@ -24,7 +24,7 @@ * This software is derived from software provide by Kwikbyte who specifically * disclaimed copyright on the code. * - * $FreeBSD: src/sys/boot/arm/at91/libat91/at91rm9200_lowlevel.c,v 1.1 2006/04/19 17:16:49 imp Exp $ + * $FreeBSD: src/sys/boot/arm/at91/libat91/at91rm9200_lowlevel.c,v 1.2 2006/04/21 07:29:14 imp Exp $ */ #include "at91rm9200.h" @@ -93,6 +93,18 @@ while (!(AT91C_BASE_PMC->PMC_SR & AT91C_PMC_MCKRDY)) continue; +#ifdef BOOT_KB9202 + // setup flash access (allow ample margin) + // 9 wait states, 1 setup, 1 hold, 1 float for 8-bit device + ((AT91PS_SMC2)AT91C_BASE_SMC2)->SMC2_CSR[0] = + AT91C_SMC2_WSEN | + (9 & AT91C_SMC2_NWS) | + ((1 << 8) & AT91C_SMC2_TDF) | + AT91C_SMC2_DBW_8 | + ((1 << 24) & AT91C_SMC2_RWSETUP) | + ((1 << 29) & AT91C_SMC2_RWHOLD); +#endif + // setup SDRAM access // EBI chip-select register (CS1 = SDRAM controller) // 9 col, 13row, 4 bank, CAS2 @@ -160,7 +172,7 @@ AT91C_BASE_PIOA->PIO_PDR = AT91C_PA31_DTXD | AT91C_PA30_DRXD; pUSART->US_IDR = (unsigned int) -1; pUSART->US_CR = - AT91C_US_RSTRX | AT91C_US_RSTTX | AT91C_US_RXDIS | AT91C_US_TXDIS; + AT91C_US_RSTRX | AT91C_US_RSTTX | AT91C_US_RXDIS | AT91C_US_TXDIS; pUSART->US_BRGR = ((((AT91C_MASTER_CLOCK*10)/(BAUD*16))+5)/10); pUSART->US_TTGR = 0; pPDC->PDC_PTCR = AT91C_PDC_RXTDIS; ==== //depot/projects/uart/boot/arm/at91/libat91/getc.c#2 (text) ==== @@ -31,7 +31,7 @@ * owners. This software is not copyrighted and is intended for reference * only. * - * $FreeBSD: src/sys/boot/arm/at91/libat91/getc.c,v 1.1 2006/04/19 17:16:49 imp Exp $ + * $FreeBSD: src/sys/boot/arm/at91/libat91/getc.c,v 1.2 2006/04/21 13:58:51 imp Exp $ */ #include "at91rm9200.h" @@ -53,10 +53,10 @@ thisSecond = GetSeconds(); seconds = thisSecond + seconds; - while (thisSecond <= seconds) { + do { if ((pUSART->US_CSR & AT91C_US_RXRDY)) return (pUSART->US_RHR & 0xFF); thisSecond = GetSeconds(); - } + } while (thisSecond < seconds); return (-1); } ==== //depot/projects/uart/boot/arm/at91/libat91/loader_prompt.c#2 (text) ==== @@ -19,7 +19,7 @@ * only. * END_BLOCK * - * $FreeBSD: src/sys/boot/arm/at91/libat91/loader_prompt.c,v 1.1 2006/04/19 17:16:49 imp Exp $ + * $FreeBSD: src/sys/boot/arm/at91/libat91/loader_prompt.c,v 1.2 2006/04/21 13:56:26 imp Exp $ *****************************************************************************/ #include "at91rm9200_lowlevel.h" @@ -420,7 +420,7 @@ printf("\r\n>"); - while (ch >= 0) + while (1) if ((ch = ((*inputFunction)(0))) > 0) ServicePrompt(ch); } ==== //depot/projects/uart/boot/arm/at91/libat91/tag_list.c#2 (text) ==== @@ -17,7 +17,7 @@ * only. * END_BLOCK * - * $FreeBSD: src/sys/boot/arm/at91/libat91/tag_list.c,v 1.1 2006/04/19 17:16:49 imp Exp $ + * $FreeBSD: src/sys/boot/arm/at91/libat91/tag_list.c,v 1.2 2006/04/21 07:19:22 imp Exp $ *****************************************************************************/ /******************************* GLOBALS *************************************/ @@ -28,7 +28,9 @@ #define u16 unsigned short #define u8 unsigned char -#include "/usr/src/arm/linux/include/asm/setup.h" +// #include "/usr/src/arm/linux/include/asm/setup.h" +#include <linux/asm/setup.h> +#include "tag_list.h" #define PAGE_SIZE 0x1000 #define MEM_SIZE 0x2000000 ==== //depot/projects/uart/boot/arm/at91/libat91/tag_list.h#2 (text) ==== @@ -1,4 +1,4 @@ -/****************************************************************************** +/***************************************************************************** * * Filename: tag_list.h * @@ -17,8 +17,8 @@ * only. * END_BLOCK * - * $FreeBSD: src/sys/boot/arm/at91/libat91/tag_list.h,v 1.1 2006/04/19 17:16:49 imp Exp $ - *****************************************************************************/ + * $FreeBSD: src/sys/boot/arm/at91/libat91/tag_list.h,v 1.2 2006/04/21 07:12:12 imp Exp $ + ****************************************************************************/ #ifndef _TAG_LIST_H_ #define _TAG_LIST_H_ ==== //depot/projects/uart/conf/files.amd64#19 (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.amd64,v 1.83 2006/03/05 22:52:16 yar Exp $ +# $FreeBSD: src/sys/conf/files.amd64,v 1.84 2006/04/21 04:24:49 peter Exp $ # # The long compile-with and dependency lines are required because of # limitations in config: backslash-newline doesn't work in strings, and @@ -104,6 +104,7 @@ amd64/amd64/locore.S standard no-obj amd64/amd64/machdep.c standard amd64/amd64/mem.c optional mem +amd64/amd64/minidump_machdep.c standard amd64/amd64/mp_machdep.c optional smp amd64/amd64/mp_watchdog.c optional mp_watchdog smp amd64/amd64/mpboot.S optional smp ==== //depot/projects/uart/conf/files.i386#24 (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.i386,v 1.553 2006/03/05 22:52:16 yar Exp $ +# $FreeBSD: src/sys/conf/files.i386,v 1.554 2006/04/21 04:28:43 peter Exp $ # # The long compile-with and dependency lines are required because of # limitations in config: backslash-newline doesn't work in strings, and @@ -270,6 +270,7 @@ i386/i386/longrun.c optional cpu_enable_longrun i386/i386/machdep.c standard i386/i386/mem.c optional mem +i386/i386/minidump_machdep.c standard i386/i386/mp_clock.c optional smp i386/i386/mp_machdep.c optional smp i386/i386/mp_watchdog.c optional mp_watchdog smp ==== //depot/projects/uart/conf/files.pc98#21 (text+ko) ==== @@ -3,7 +3,7 @@ # # modified for PC-9801/PC-9821 # -# $FreeBSD: src/sys/conf/files.pc98,v 1.336 2006/03/05 22:52:16 yar Exp $ +# $FreeBSD: src/sys/conf/files.pc98,v 1.337 2006/04/21 12:13:11 nyan Exp $ # # The long compile-with and dependency lines are required because of # limitations in config: backslash-newline doesn't work in strings, and @@ -159,6 +159,7 @@ i386/i386/local_apic.c optional apic i386/i386/locore.s standard no-obj i386/i386/mem.c optional mem +i386/i386/minidump_machdep.c standard i386/i386/mp_clock.c optional smp i386/i386/mp_machdep.c optional smp i386/i386/mp_watchdog.c optional mp_watchdog smp ==== //depot/projects/uart/i386/i386/dump_machdep.c#4 (text+ko) ==== @@ -25,12 +25,13 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/i386/i386/dump_machdep.c,v 1.11 2005/07/02 19:57:31 marcel Exp $"); +__FBSDID("$FreeBSD: src/sys/i386/i386/dump_machdep.c,v 1.12 2006/04/21 04:28:43 peter Exp $"); #include <sys/param.h> #include <sys/systm.h> #include <sys/conf.h> #include <sys/cons.h> +#include <sys/sysctl.h> #include <sys/kernel.h> #include <sys/kerneldump.h> #include <vm/vm.h> @@ -40,6 +41,11 @@ CTASSERT(sizeof(struct kerneldumpheader) == 512); +int do_minidump = 1; +TUNABLE_INT("debug.minidump", &do_minidump); +SYSCTL_INT(_debug, OID_AUTO, minidump, CTLFLAG_RW, &do_minidump, 0, + "Enable mini crash dumps"); + /* * Don't touch the first SIZEOF_METADATA bytes on the dump device. This * is to protect us from metadata and to protect metadata from us. @@ -272,6 +278,10 @@ size_t hdrsz; int error; + if (do_minidump) { + minidumpsys(di); + return; + } bzero(&ehdr, sizeof(ehdr)); ehdr.e_ident[EI_MAG0] = ELFMAG0; ehdr.e_ident[EI_MAG1] = ELFMAG1; ==== //depot/projects/uart/i386/include/md_var.h#8 (text+ko) ==== @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/i386/include/md_var.h,v 1.73 2005/10/14 22:52:01 jkim Exp $ + * $FreeBSD: src/sys/i386/include/md_var.h,v 1.74 2006/04/21 04:28:43 peter Exp $ */ #ifndef _MACHINE_MD_VAR_H_ @@ -65,12 +65,15 @@ #ifdef COMPAT_43 extern int szosigcode; #endif +extern uint32_t *vm_page_dump; +extern int vm_page_dump_size; typedef void alias_for_inthand_t(u_int cs, u_int ef, u_int esp, u_int ss); struct thread; struct reg; struct fpreg; struct dbreg; +struct dumperinfo; void bcopyb(const void *from, void *to, size_t len); void busdma_swi(void); @@ -84,6 +87,8 @@ void doreti_popl_es_fault(void) __asm(__STRING(doreti_popl_es_fault)); void doreti_popl_fs(void) __asm(__STRING(doreti_popl_fs)); void doreti_popl_fs_fault(void) __asm(__STRING(doreti_popl_fs_fault)); +void dump_add_page(vm_paddr_t); +void dump_drop_page(vm_paddr_t); void enable_sse(void); void fillw(int /*u_short*/ pat, void *base, size_t cnt); void i486_bzero(void *buf, size_t len); @@ -99,5 +104,6 @@ vm_paddr_t kvtop(void *addr); void setidt(int idx, alias_for_inthand_t *func, int typ, int dpl, int selec); int user_dbreg_trap(void); +void minidumpsys(struct dumperinfo *); #endif /* !_MACHINE_MD_VAR_H_ */ ==== //depot/projects/uart/ia64/ia64/nexus.c#8 (text+ko) ==== @@ -26,7 +26,7 @@ * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/ia64/ia64/nexus.c,v 1.13 2006/04/20 04:18:30 imp Exp $ + * $FreeBSD: src/sys/ia64/ia64/nexus.c,v 1.14 2006/04/21 16:12:28 marcel Exp $ */ /* @@ -496,13 +496,11 @@ } static int -nexus_teardown_intr(device_t dev, device_t child, struct resource *r, void *ih) +nexus_teardown_intr(device_t dev, device_t child, struct resource *ires, + void *cookie) { -#if 0 - return (inthand_remove(ih)); -#else - return 0; -#endif + + return (ia64_teardown_intr(cookie)); } static struct resource_list * ==== //depot/projects/uart/kern/kern_mbuf.c#10 (text+ko) ==== @@ -26,7 +26,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/kern/kern_mbuf.c,v 1.23 2006/03/08 14:05:38 andre Exp $"); +__FBSDID("$FreeBSD: src/sys/kern/kern_mbuf.c,v 1.24 2006/04/21 09:25:39 ps Exp $"); #include "opt_mac.h" #include "opt_param.h" @@ -112,7 +112,25 @@ SYSCTL_DECL(_kern_ipc); /* XXX: These should be tuneables. Can't change UMA limits on the fly. */ -SYSCTL_INT(_kern_ipc, OID_AUTO, nmbclusters, CTLFLAG_RW, &nmbclusters, 0, +static int +sysctl_nmbclusters(SYSCTL_HANDLER_ARGS) +{ + int error, newnmbclusters; + + newnmbclusters = nmbclusters; + error = sysctl_handle_int(oidp, &newnmbclusters, sizeof(int), req); + if (error == 0 && req->newptr) { + if (newnmbclusters > nmbclusters) { + nmbclusters = newnmbclusters; + uma_zone_set_max(zone_clust, nmbclusters); + EVENTHANDLER_INVOKE(nmbclusters_change); + } else + error = EINVAL; + } + return (error); +} +SYSCTL_PROC(_kern_ipc, OID_AUTO, nmbclusters, CTLTYPE_INT|CTLFLAG_RW, +&nmbclusters, 0, sysctl_nmbclusters, "IU", "Maximum number of mbuf clusters allowed"); SYSCTL_INT(_kern_ipc, OID_AUTO, nmbjumbop, CTLFLAG_RW, &nmbjumbop, 0, "Maximum number of mbuf page size jumbo clusters allowed"); ==== //depot/projects/uart/kern/uipc_domain.c#9 (text+ko) ==== @@ -30,12 +30,13 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/kern/uipc_domain.c,v 1.45 2006/02/18 17:16:18 andre Exp $"); +__FBSDID("$FreeBSD: src/sys/kern/uipc_domain.c,v 1.46 2006/04/21 09:25:39 ps Exp $"); #include <sys/param.h> #include <sys/socket.h> #include <sys/protosw.h> #include <sys/domain.h> +#include <sys/eventhandler.h> #include <sys/mbuf.h> #include <sys/kernel.h> #include <sys/lock.h> @@ -189,6 +190,13 @@ net_init_domain(dp); } +static void +socket_zone_change(void *tag) +{ + + uma_zone_set_max(socket_zone, maxsockets); +} + /* ARGSUSED*/ static void domaininit(void *dummy) @@ -201,6 +209,8 @@ socket_zone = uma_zcreate("socket", sizeof(struct socket), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE); uma_zone_set_max(socket_zone, maxsockets); + EVENTHANDLER_REGISTER(maxsockets_change, socket_zone_change, NULL, + EVENTHANDLER_PRI_FIRST); if (max_linkhdr < 16) /* XXX */ max_linkhdr = 16; ==== //depot/projects/uart/kern/uipc_socket2.c#12 (text+ko) ==== @@ -30,7 +30,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/kern/uipc_socket2.c,v 1.155 2006/04/01 15:41:58 rwatson Exp $"); +__FBSDID("$FreeBSD: src/sys/kern/uipc_socket2.c,v 1.156 2006/04/21 09:25:39 ps Exp $"); #include "opt_mac.h" #include "opt_param.h" @@ -39,6 +39,7 @@ #include <sys/aio.h> /* for aio_swake proto */ #include <sys/domain.h> #include <sys/event.h> +#include <sys/eventhandler.h> #include <sys/file.h> /* for maxfiles */ #include <sys/kernel.h> #include <sys/lock.h> @@ -1508,8 +1509,29 @@ SYSCTL_INT(_kern, KERN_DUMMY, dummy, CTLFLAG_RW, &dummy, 0, ""); SYSCTL_OID(_kern_ipc, KIPC_MAXSOCKBUF, maxsockbuf, CTLTYPE_ULONG|CTLFLAG_RW, &sb_max, 0, sysctl_handle_sb_max, "LU", "Maximum socket buffer size"); -SYSCTL_INT(_kern_ipc, OID_AUTO, maxsockets, CTLFLAG_RDTUN, - &maxsockets, 0, "Maximum number of sockets avaliable"); +static int +sysctl_maxsockets(SYSCTL_HANDLER_ARGS) +{ + int error, newmaxsockets; + + newmaxsockets = maxsockets; + error = sysctl_handle_int(oidp, &newmaxsockets, sizeof(int), req); + if (error == 0 && req->newptr) { + if (newmaxsockets > maxsockets) { + maxsockets = newmaxsockets; + if (maxsockets > ((maxfiles / 4) * 3)) { + maxfiles = (maxsockets * 5) / 4; + maxfilesperproc = (maxfiles * 9) / 10; + } + EVENTHANDLER_INVOKE(maxsockets_change); + } else + error = EINVAL; + } + return (error); +} +SYSCTL_PROC(_kern_ipc, OID_AUTO, maxsockets, CTLTYPE_INT|CTLFLAG_RW, + &maxsockets, 0, sysctl_maxsockets, "IU", + "Maximum number of sockets avaliable"); SYSCTL_ULONG(_kern_ipc, KIPC_SOCKBUF_WASTE, sockbuf_waste_factor, CTLFLAG_RW, &sb_efficiency, 0, ""); ==== //depot/projects/uart/kern/uipc_usrreq.c#12 (text+ko) ==== @@ -32,7 +32,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/kern/uipc_usrreq.c,v 1.165 2006/04/01 15:41:58 rwatson Exp $"); +__FBSDID("$FreeBSD: src/sys/kern/uipc_usrreq.c,v 1.166 2006/04/21 09:25:39 ps Exp $"); #include "opt_mac.h" @@ -40,6 +40,7 @@ #include <sys/domain.h> #include <sys/fcntl.h> #include <sys/malloc.h> /* XXX must be before <sys/file.h> */ +#include <sys/eventhandler.h> #include <sys/file.h> #include <sys/filedesc.h> #include <sys/jail.h> @@ -1325,6 +1326,13 @@ return (error); } +static void +unp_zone_change(void *tag) +{ + + uma_zone_set_max(unp_zone, maxsockets); +} + void unp_init(void) { @@ -1332,7 +1340,9 @@ NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE); if (unp_zone == NULL) panic("unp_init"); - uma_zone_set_max(unp_zone, nmbclusters); + uma_zone_set_max(unp_zone, maxsockets); + EVENTHANDLER_REGISTER(maxsockets_change, unp_zone_change, + NULL, EVENTHANDLER_PRI_ANY); LIST_INIT(&unp_dhead); LIST_INIT(&unp_shead); TASK_INIT(&unp_gc_task, 0, unp_gc, NULL); ==== //depot/projects/uart/netinet/ip_divert.c#12 (text+ko) ==== @@ -26,7 +26,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $FreeBSD: src/sys/netinet/ip_divert.c,v 1.117 2006/04/03 09:01:17 rwatson Exp $ + * $FreeBSD: src/sys/netinet/ip_divert.c,v 1.118 2006/04/21 09:25:39 ps Exp $ */ #if !defined(KLD_MODULE) @@ -116,6 +116,13 @@ /* * Initialize divert connection block queue. */ +static void +div_zone_change(void *tag) +{ + + uma_zone_set_max(divcbinfo.ipi_zone, maxsockets); +} + void div_init(void) { @@ -132,6 +139,8 @@ divcbinfo.ipi_zone = uma_zcreate("divcb", sizeof(struct inpcb), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE); uma_zone_set_max(divcbinfo.ipi_zone, maxsockets); + EVENTHANDLER_REGISTER(maxsockets_change, div_zone_change, + NULL, EVENTHANDLER_PRI_ANY); } /* ==== //depot/projects/uart/netinet/ip_input.c#15 (text+ko) ==== @@ -27,7 +27,7 @@ * SUCH DAMAGE. * * @(#)ip_input.c 8.2 (Berkeley) 1/4/94 - * $FreeBSD: src/sys/netinet/ip_input.c,v 1.315 2006/02/07 11:48:10 oleg Exp $ + * $FreeBSD: src/sys/netinet/ip_input.c,v 1.316 2006/04/21 09:25:39 ps Exp $ */ #include "opt_bootp.h" @@ -167,6 +167,7 @@ #define IPQ_LOCK_ASSERT() mtx_assert(&ipqlock, MA_OWNED) static void maxnipq_update(void); +static void ipq_zone_change(void *); static int maxnipq; /* Administrative limit on # reass queues. */ static int nipq = 0; /* Total # of reass queues */ @@ -256,6 +257,8 @@ ipport_tick(NULL); EVENTHANDLER_REGISTER(shutdown_pre_sync, ip_fini, NULL, SHUTDOWN_PRI_DEFAULT); + EVENTHANDLER_REGISTER(nmbclusters_change, ipq_zone_change, + NULL, EVENTHANDLER_PRI_ANY); /* Initialize various other remaining things. */ ip_id = time_second & 0xffff; @@ -687,6 +690,16 @@ uma_zone_set_max(ipq_zone, 1); } +static void +ipq_zone_change(void *tag) +{ + + if (maxnipq > 0 && maxnipq < (nmbclusters / 32)) { + maxnipq = nmbclusters / 32; + maxnipq_update(); + } +} + static int sysctl_maxnipq(SYSCTL_HANDLER_ARGS) { ==== //depot/projects/uart/netinet/raw_ip.c#15 (text+ko) ==== @@ -27,7 +27,7 @@ * SUCH DAMAGE. * * @(#)raw_ip.c 8.7 (Berkeley) 5/15/95 - * $FreeBSD: src/sys/netinet/raw_ip.c,v 1.159 2006/04/01 16:20:53 rwatson Exp $ + * $FreeBSD: src/sys/netinet/raw_ip.c,v 1.160 2006/04/21 09:25:39 ps Exp $ */ #include "opt_inet6.h" @@ -116,6 +116,13 @@ /* * Initialize raw connection block q. */ +static void +rip_zone_change(void *tag) +{ + + uma_zone_set_max(ripcbinfo.ipi_zone, maxsockets); +} + void rip_init() { @@ -132,6 +139,8 @@ ripcbinfo.ipi_zone = uma_zcreate("ripcb", sizeof(struct inpcb), NULL, NULL, NULL, NULL, UMA_ALIGN_PTR, UMA_ZONE_NOFREE); uma_zone_set_max(ripcbinfo.ipi_zone, maxsockets); + EVENTHANDLER_REGISTER(maxsockets_change, rip_zone_change, + NULL, EVENTHANDLER_PRI_ANY); } static struct sockaddr_in ripsrc = { sizeof(ripsrc), AF_INET }; ==== //depot/projects/uart/netinet/tcp_input.c#23 (text+ko) ==== @@ -27,7 +27,7 @@ * SUCH DAMAGE. * * @(#)tcp_input.c 8.12 (Berkeley) 5/24/95 - * $FreeBSD: src/sys/netinet/tcp_input.c,v 1.297 2006/04/09 16:59:19 rwatson Exp $ + * $FreeBSD: src/sys/netinet/tcp_input.c,v 1.298 2006/04/21 09:25:39 ps Exp $ */ #include "opt_ipfw.h" /* for ipfw_fwd */ @@ -202,6 +202,14 @@ (tcp_delack_enabled || (tp->t_flags & TF_NEEDSYN))) /* Initialize TCP reassembly queue */ +static void +tcp_reass_zone_change(void *tag) +{ >>> TRUNCATED FOR MAIL (1000 lines) <<<
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200604211622.k3LGM790014452>