Date: Sun, 21 Nov 2004 00:02:50 GMT From: Marcel Moolenaar <marcel@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 65588 for review Message-ID: <200411210002.iAL02oA7006265@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=65588 Change 65588 by marcel@marcel_nfs on 2004/11/21 00:01:57 IFC @65587 Affected files ... .. //depot/projects/uart/arm/arm/exception.S#2 integrate .. //depot/projects/uart/arm/arm/undefined.c#2 integrate .. //depot/projects/uart/arm/arm/vm_machdep.c#4 integrate .. //depot/projects/uart/arm/include/cpufunc.h#3 integrate .. //depot/projects/uart/arm/include/db_machdep.h#2 integrate .. //depot/projects/uart/arm/include/param.h#5 integrate .. //depot/projects/uart/arm/sa11x0/assabet_machdep.c#3 integrate .. //depot/projects/uart/arm/xscale/i80321/iq31244_machdep.c#5 integrate .. //depot/projects/uart/dev/ic/ns16550.h#4 integrate .. //depot/projects/uart/dev/ic/sab82532.h#1 branch .. //depot/projects/uart/dev/ic/z8530.h#1 branch .. //depot/projects/uart/dev/uart/uart_dev_ns8250.c#33 integrate .. //depot/projects/uart/geom/uzip/g_uzip.c#2 integrate .. //depot/projects/uart/kern/kern_fork.c#9 integrate .. //depot/projects/uart/kern/kern_kse.c#2 integrate .. //depot/projects/uart/kern/kern_proc.c#9 integrate .. //depot/projects/uart/kern/kern_switch.c#5 integrate .. //depot/projects/uart/kern/kern_thr.c#5 integrate .. //depot/projects/uart/kern/kern_thread.c#13 integrate .. //depot/projects/uart/modules/sio/Makefile#2 integrate .. //depot/projects/uart/modules/uart/Makefile#12 integrate Differences ... ==== //depot/projects/uart/arm/arm/exception.S#2 (text+ko) ==== @@ -51,7 +51,7 @@ #include <machine/asm.h> #include <machine/armreg.h> #include <machine/asmacros.h> -__FBSDID("$FreeBSD: src/sys/arm/arm/exception.S,v 1.3 2004/09/23 22:05:39 cognet Exp $"); +__FBSDID("$FreeBSD: src/sys/arm/arm/exception.S,v 1.4 2004/11/20 16:52:30 cognet Exp $"); .text .align 0 @@ -206,122 +206,6 @@ * look like direct entry from the vector. */ ASENTRY_NP(undefined_entry) -#ifdef IPKDB -/* - * IPKDB must be hooked in at the earliest possible entry point. - * - */ -/* - * Make room for all registers saving real r0-r7 and r15. - * The remaining registers are updated later. - */ - stmfd sp!, {r0,r1} /* psr & spsr */ - stmfd sp!, {lr} /* pc */ - stmfd sp!, {r0-r14} /* r0-r7, r8-r14 */ -/* - * Get previous psr. - */ - mrs r7, cpsr_all - mrs r0, spsr_all - str r0, [sp, #(16*4)] -/* - * Test for user mode. - */ - tst r0, #0xf - bne .Lprenotuser_push - add r1, sp, #(8*4) - stmia r1,{r8-r14}^ /* store user mode r8-r14*/ - b .Lgoipkdb -/* - * Switch to previous mode to get r8-r13. - */ -.Lprenotuser_push: - orr r0, r0, #(I32_bit) /* disable interrupts */ - msr cpsr_all, r0 - mov r1, r8 - mov r2, r9 - mov r3, r10 - mov r4, r11 - mov r5, r12 - mov r6, r13 - msr cpsr_all, r7 /* back to undefined mode */ - add r8, sp, #(8*4) - stmia r8, {r1-r6} /* r8-r13 */ -/* - * Now back to previous mode to get r14 and spsr. - */ - msr cpsr_all, r0 - mov r1, r14 - mrs r2, spsr - msr cpsr_all, r7 /* back to undefined mode */ - str r1, [sp, #(14*4)] /* r14 */ - str r2, [sp, #(17*4)] /* spsr */ -/* - * Now to IPKDB. - */ -.Lgoipkdb: - mov r0, sp - bl _C_LABEL(ipkdb_trap_glue) - ldr r1, .Lipkdb_trap_return - str r0,[r1] - -/* - * Have to load all registers from the stack. - * - * Start with spsr and pc. - */ - ldr r0, [sp, #(16*4)] /* spsr */ - ldr r1, [sp, #(15*4)] /* r15 */ - msr spsr_all, r0 - mov r14, r1 -/* - * Test for user mode. - */ - tst r0, #0xf - bne .Lprenotuser_pull - add r1, sp, #(8*4) - ldmia r1, {r8-r14}^ /* load user mode r8-r14 */ - b .Lpull_r0r7 -.Lprenotuser_pull: -/* - * Now previous mode spsr and r14. - */ - ldr r1, [sp, #(17*4)] /* spsr */ - ldr r2, [sp, #(14*4)] /* r14 */ - orr r0, r0, #(I32_bit) - msr cpsr_all, r0 /* switch to previous mode */ - msr spsr_all, r1 - mov r14, r2 - msr cpsr_all, r7 /* back to undefined mode */ -/* - * Now r8-r13. - */ - add r8, sp, #(8*4) - ldmia r8, {r1-r6} /* r8-r13 */ - msr cpsr_all, r0 - mov r8, r1 - mov r9, r2 - mov r10, r3 - mov r11, r4 - mov r12, r5 - mov r13, r6 - msr cpsr_all, r7 -.Lpull_r0r7: -/* - * Now the rest of the registers. - */ - ldr r1,Lipkdb_trap_return - ldr r0,[r1] - tst r0,r0 - ldmfd sp!, {r0-r7} /* r0-r7 */ - add sp, sp, #(10*4) /* adjust sp */ - -/* - * Did IPKDB handle it? - */ - movnes pc, lr /* return */ - -#endif stmfd sp!, {r0, r1} ldr r0, Lundefined_handler_indirection ldr r1, [sp], #0x0004 @@ -330,10 +214,6 @@ str r1, [r0, #0x0004] ldmia r0, {r0, r1, pc} -#ifdef IPKDB -Lipkdb_trap_return: - .word Lipkdb_trap_return_data -#endif Lundefined_handler_indirection: .word Lundefined_handler_indirection_data ==== //depot/projects/uart/arm/arm/undefined.c#2 (text+ko) ==== @@ -46,7 +46,7 @@ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/arm/arm/undefined.c,v 1.1 2004/05/14 11:46:42 cognet Exp $"); +__FBSDID("$FreeBSD: src/sys/arm/arm/undefined.c,v 1.2 2004/11/20 16:52:10 cognet Exp $"); #include <sys/param.h> #include <sys/malloc.h> @@ -60,6 +60,9 @@ #include <sys/types.h> #include <sys/lock.h> #include <sys/mutex.h> +#ifdef KDB +#include <sys/kdb.h> +#endif #ifdef FAST_FPE #include <sys/acct.h> #endif @@ -188,6 +191,7 @@ enable_interrupts(I32_bit); frame->tf_pc -= INSN_SIZE; + atomic_add_int(&cnt.v_trap, 1); fault_pc = frame->tf_pc; @@ -251,13 +255,30 @@ fault_code) == 0) break; - if (uh == NULL) { + if (uh == NULL && (fault_code & FAULT_USER)) { /* Fault has not been handled */ trapsignal(td, SIGILL, 0); } - if ((fault_code & FAULT_USER) == 0) + if ((fault_code & FAULT_USER) == 0) { + if (fault_instruction == KERNEL_BREAKPOINT) { +#ifdef KDB + kdb_trap(0, 0, frame); +#else + printf("No debugger in kernel.\n"); +#endif + frame->tf_pc += 4; return; + } else { +#ifdef KDB + printf("Undefined instruction in kernel.\n"); + kdb_trap(0, 0, frame); +#else + panic("Undefined instruction in kernel.\n"); +#endif + } + + } #ifdef FAST_FPE /* Optimised exit code */ ==== //depot/projects/uart/arm/arm/vm_machdep.c#4 (text+ko) ==== @@ -81,7 +81,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/arm/arm/vm_machdep.c,v 1.7 2004/11/20 02:31:23 das Exp $"); +__FBSDID("$FreeBSD: src/sys/arm/arm/vm_machdep.c,v 1.8 2004/11/20 16:51:32 cognet Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -145,7 +145,6 @@ struct trapframe *tf; struct switchframe *sf; struct mdproc *mdp2; - vm_offset_t uarea = td2->td_kstack + td2->td_kstack_pages * PAGE_SIZE; pcb1 = td1->td_pcb; pcb2 = (struct pcb *)(td2->td_kstack + td2->td_kstack_pages * PAGE_SIZE) - 1; @@ -156,8 +155,8 @@ bcopy(td1->td_pcb, pcb2, sizeof(*pcb2)); mdp2 = &p2->p_md; bcopy(&td1->td_proc->p_md, mdp2, sizeof(*mdp2)); - pcb2->un_32.pcb32_und_sp = uarea + USPACE_UNDEF_STACK_TOP; - pcb2->un_32.pcb32_sp = uarea + + pcb2->un_32.pcb32_und_sp = td2->td_kstack + USPACE_UNDEF_STACK_TOP; + pcb2->un_32.pcb32_sp = td2->td_kstack + USPACE_SVC_STACK_TOP - sizeof(*pcb2); pmap_activate(td2); td2->td_frame = tf = ==== //depot/projects/uart/arm/include/cpufunc.h#3 (text+ko) ==== @@ -38,7 +38,7 @@ * * Prototypes for cpu, mmu and tlb related functions. * - * $FreeBSD: src/sys/arm/include/cpufunc.h,v 1.4 2004/11/04 19:18:50 cognet Exp $ + * $FreeBSD: src/sys/arm/include/cpufunc.h,v 1.5 2004/11/20 16:52:09 cognet Exp $ */ #ifndef _MACHINE_CPUFUNC_H_ @@ -53,6 +53,7 @@ static __inline void breakpoint(void) { + __asm(".word 0xe7ffffff"); } struct cpu_functions { ==== //depot/projects/uart/arm/include/db_machdep.h#2 (text+ko) ==== @@ -24,7 +24,7 @@ * the rights to redistribute these changes. * * from: FreeBSD: src/sys/i386/include/db_machdep.h,v 1.16 1999/10/04 - * $FreeBSD: src/sys/arm/include/db_machdep.h,v 1.2 2004/07/12 21:25:01 cognet Exp $ + * $FreeBSD: src/sys/arm/include/db_machdep.h,v 1.3 2004/11/20 16:52:09 cognet Exp $ */ #ifndef _MACHINE_DB_MACHDEP_H_ @@ -47,7 +47,7 @@ #define BKPT_SET(inst) (BKPT_INST) #define BKPT_SKIP do { \ - kdb_frame->tf_pc -= BKPT_SIZE; \ + kdb_frame->tf_pc += BKPT_SIZE; \ } while (0) #define db_clear_single_step(regs) @@ -56,9 +56,25 @@ #define IS_BREAKPOINT_TRAP(type, code) (type == T_BREAKPOINT) #define IS_WATCHPOINT_TRAP(type, code) (0) + #define inst_trap_return(ins) (0) -#define inst_return(ins) (0) -#define inst_call(ins) (0) +/* ldmxx reg, {..., pc} + 01800000 stack mode + 000f0000 register + 0000ffff register list */ +/* mov pc, reg + 0000000f register */ +#define inst_return(ins) (((ins) & 0x0e108000) == 0x08108000 || \ + ((ins) & 0x0ff0fff0) == 0x01a0f000) +/* bl ... + 00ffffff offset>>2 */ +#define inst_call(ins) (((ins) & 0x0f000000) == 0x0b000000) +/* b ... + 00ffffff offset>>2 */ +/* ldr pc, [pc, reg, lsl #2] + 0000000f register */ + + #define inst_load(ins) (0) #define inst_store(ins) (0) ==== //depot/projects/uart/arm/include/param.h#5 (text+ko) ==== @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * from: @(#)param.h 5.8 (Berkeley) 6/28/91 - * $FreeBSD: src/sys/arm/include/param.h,v 1.8 2004/11/20 02:31:37 das Exp $ + * $FreeBSD: src/sys/arm/include/param.h,v 1.9 2004/11/20 16:51:32 cognet Exp $ */ /* @@ -106,7 +106,7 @@ #define KSTACK_GUARD_PAGES 1 #endif /* !KSTACK_GUARD_PAGES */ -#define USPACE_SVC_STACK_TOP 0 +#define USPACE_SVC_STACK_TOP KSTACK_PAGES * PAGE_SIZE #define USPACE_SVC_STACK_BOTTOM (USPACE_SVC_STACK_TOP - 0x1000) #define USPACE_UNDEF_STACK_TOP (USPACE_SVC_STACK_BOTTOM - 0x10) #define USPACE_UNDEF_STACK_BOTTOM (FPCONTEXTSIZE + 10) ==== //depot/projects/uart/arm/sa11x0/assabet_machdep.c#3 (text+ko) ==== @@ -47,7 +47,7 @@ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/arm/sa11x0/assabet_machdep.c,v 1.6 2004/11/20 02:29:24 das Exp $"); +__FBSDID("$FreeBSD: src/sys/arm/sa11x0/assabet_machdep.c,v 1.7 2004/11/20 16:51:32 cognet Exp $"); #include "opt_md.h" @@ -417,5 +417,6 @@ init_param2(physmem); kdb_init(); avail_end = 0xc0000000 + 0x02000000 - 1; - return ((void *)(kernelstack.pv_va + USPACE_SVC_STACK_TOP)); + return ((void *)(kernelstack.pv_va + USPACE_SVC_STACK_TOP - + sizeof(struct pcb))); } ==== //depot/projects/uart/arm/xscale/i80321/iq31244_machdep.c#5 (text+ko) ==== @@ -48,7 +48,7 @@ #include "opt_msgbuf.h" #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/arm/xscale/i80321/iq31244_machdep.c,v 1.4 2004/11/20 02:29:24 das Exp $"); +__FBSDID("$FreeBSD: src/sys/arm/xscale/i80321/iq31244_machdep.c,v 1.5 2004/11/20 16:51:32 cognet Exp $"); #define _ARM32_BUS_DMA_PRIVATE #include <sys/param.h> @@ -432,5 +432,6 @@ init_param2(physmem); avail_end = 0xa0000000 + memsize - 1; kdb_init(); - return ((void *)(kernelstack.pv_va + USPACE_SVC_STACK_TOP)); + return ((void *)(kernelstack.pv_va + USPACE_SVC_STACK_TOP - + sizeof(struct pcb))); } ==== //depot/projects/uart/dev/ic/ns16550.h#4 (text+ko) ==== @@ -27,7 +27,7 @@ * SUCH DAMAGE. * * from: @(#)ns16550.h 7.1 (Berkeley) 5/9/91 - * $FreeBSD: src/sys/dev/ic/ns16550.h,v 1.15 2004/04/07 20:45:57 imp Exp $ + * $FreeBSD: src/sys/dev/ic/ns16550.h,v 1.16 2004/11/20 23:19:42 marcel Exp $ */ /* @@ -37,17 +37,17 @@ /* 8250 registers #[0-6]. */ #define com_data 0 /* data register (R/W) */ -#define com_thr com_data /* transmitter holding register (W) */ -#define com_rhr com_data /* receiver holding register (R) */ +#define REG_DATA com_data #define com_ier 1 /* interrupt enable register (W) */ +#define REG_IER com_ier #define IER_ERXRDY 0x1 #define IER_ETXRDY 0x2 #define IER_ERLS 0x4 #define IER_EMSC 0x8 #define com_iir 2 /* interrupt identification register (R) */ -#define com_isr com_iir /* interrupt status register (R) */ +#define REG_IIR com_iir #define IIR_IMASK 0xf #define IIR_RXTOUT 0xc #define IIR_RLS 0x6 @@ -58,36 +58,52 @@ #define IIR_FIFO_MASK 0xc0 /* set if FIFOs are enabled */ #define com_lcr 3 /* line control register (R/W) */ -#define com_lctl com_lcr #define com_cfcr com_lcr /* character format control register (R/W) */ +#define REG_LCR com_lcr #define LCR_DLAB 0x80 #define CFCR_DLAB LCR_DLAB #define LCR_EFR_ENABLE 0xbf /* magic to enable EFR on 16650 up */ #define CFCR_EFR_ENABLE LCR_EFR_ENABLE -#define CFCR_SBREAK 0x40 -#define CFCR_PZERO 0x30 -#define CFCR_PONE 0x20 -#define CFCR_PEVEN 0x10 -#define CFCR_PODD 0x00 -#define CFCR_PENAB 0x08 -#define CFCR_STOPB 0x04 -#define CFCR_8BITS 0x03 -#define CFCR_7BITS 0x02 -#define CFCR_6BITS 0x01 -#define CFCR_5BITS 0x00 +#define LCR_SBREAK 0x40 +#define CFCR_SBREAK LCR_SBREAK +#define LCR_PZERO 0x30 +#define CFCR_PZERO LCR_PZERO +#define LCR_PONE 0x20 +#define CFCR_PONE LCR_PONE +#define LCR_PEVEN 0x10 +#define CFCR_PEVEN LCR_PEVEN +#define LCR_PODD 0x00 +#define CFCR_PODD LCR_PODD +#define LCR_PENAB 0x08 +#define CFCR_PENAB LCR_PENAB +#define LCR_STOPB 0x04 +#define CFCR_STOPB LCR_STOPB +#define LCR_8BITS 0x03 +#define CFCR_8BITS LCR_8BITS +#define LCR_7BITS 0x02 +#define CFCR_7BITS LCR_7BITS +#define LCR_6BITS 0x01 +#define CFCR_6BITS LCR_6BITS +#define LCR_5BITS 0x00 +#define CFCR_5BITS LCR_5BITS #define com_mcr 4 /* modem control register (R/W) */ +#define REG_MCR com_mcr #define MCR_PRESCALE 0x80 /* only available on 16650 up */ #define MCR_LOOPBACK 0x10 -#define MCR_IENABLE 0x08 +#define MCR_IE 0x08 +#define MCR_IENABLE MCR_IE #define MCR_DRS 0x04 #define MCR_RTS 0x02 #define MCR_DTR 0x01 #define com_lsr 5 /* line status register (R/W) */ +#define REG_LSR com_lsr #define LSR_RCV_FIFO 0x80 -#define LSR_TSRE 0x40 -#define LSR_TXRDY 0x20 +#define LSR_TEMT 0x40 +#define LSR_TSRE LSR_TEMT +#define LSR_THRE 0x20 +#define LSR_TXRDY LSR_THRE #define LSR_BI 0x10 #define LSR_FE 0x08 #define LSR_PE 0x04 @@ -96,6 +112,7 @@ #define LSR_RCV_MASK 0x1f #define com_msr 6 /* modem status register (R/W) */ +#define REG_MSR com_msr #define MSR_DCD 0x80 #define MSR_RI 0x40 #define MSR_DSR 0x20 @@ -110,6 +127,7 @@ #define com_dlbl com_dll #define com_dlm 1 /* divisor latch high (R/W) */ #define com_dlbh com_dlm +#define REG_DL com_dll /* 16450 register #7. Not multiplexed. */ #define com_scr 7 /* scratch register (R/W) */ @@ -117,20 +135,32 @@ /* 16550 register #2. Not multiplexed. */ #define com_fcr 2 /* FIFO control register (W) */ #define com_fifo com_fcr -#define FIFO_ENABLE 0x01 -#define FIFO_RCV_RST 0x02 -#define FIFO_XMT_RST 0x04 -#define FIFO_DMA_MODE 0x08 -#define FIFO_RX_LOW 0x00 -#define FIFO_RX_MEDL 0x40 -#define FIFO_RX_MEDH 0x80 -#define FIFO_RX_HIGH 0xc0 +#define REG_FCR com_fcr +#define FCR_ENABLE 0x01 +#define FIFO_ENABLE FCR_ENABLE +#define FCR_RCV_RST 0x02 +#define FIFO_RCV_RST FCR_RCV_RST +#define FCR_XMT_RST 0x04 +#define FIFO_XMT_RST FCR_XMT_RST +#define FCR_DMA 0x08 +#define FIFO_DMA_MODE FCR_DMA +#define FCR_RX_LOW 0x00 +#define FIFO_RX_LOW FCR_RX_LOW +#define FCR_RX_MEDL 0x40 +#define FIFO_RX_MEDL FCR_RX_MEDL +#define FCR_RX_MEDH 0x80 +#define FIFO_RX_MEDH FCR_RX_MEDH +#define FCR_RX_HIGH 0xc0 +#define FIFO_RX_HIGH FCR_RX_HIGH /* 16650 registers #2,[4-7]. Access enabled by LCR_EFR_ENABLE. */ #define com_efr 2 /* enhanced features register (R/W) */ -#define EFR_AUTOCTS 0x80 -#define EFR_AUTORTS 0x40 +#define REG_EFR com_efr +#define EFR_CTS 0x80 +#define EFR_AUTOCTS EFR_CTS +#define EFR_RTS 0x40 +#define EFR_AUTORTS EFR_RTS #define EFR_EFE 0x10 /* enhanced functions enable */ #define com_xon1 4 /* XON 1 character (R/W) */ @@ -162,6 +192,7 @@ * index into the Indexed Control register set. */ #define com_spr com_scr /* scratch pad (and index) register (R/W) */ +#define REG_SPR com_scr /* * 16950 indexed control registers #[0-0x13]. Access is via index in SPR, ==== //depot/projects/uart/dev/uart/uart_dev_ns8250.c#33 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/dev/uart/uart_dev_ns8250.c,v 1.12 2004/11/15 00:00:24 marcel Exp $"); +__FBSDID("$FreeBSD: src/sys/dev/uart/uart_dev_ns8250.c,v 1.13 2004/11/20 23:22:04 marcel Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -36,7 +36,8 @@ #include <dev/uart/uart.h> #include <dev/uart/uart_cpu.h> #include <dev/uart/uart_bus.h> -#include <dev/uart/uart_dev_ns8250.h> + +#include <dev/ic/ns16550.h> #include "uart_if.h" ==== //depot/projects/uart/geom/uzip/g_uzip.c#2 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/geom/uzip/g_uzip.c,v 1.3 2004/09/19 10:27:46 fjoe Exp $"); +__FBSDID("$FreeBSD: src/sys/geom/uzip/g_uzip.c,v 1.4 2004/11/20 13:10:04 fjoe Exp $"); #include <sys/param.h> #include <sys/bio.h> @@ -393,7 +393,7 @@ /* * Initialize softc and read offsets. */ - sc = malloc(sizeof(*sc), M_GEOM_UZIP, M_WAITOK); + sc = malloc(sizeof(*sc), M_GEOM_UZIP, M_WAITOK | M_ZERO); gp->softc = sc; sc->blksz = ntohl(header->blksz); sc->nblocks = ntohl(header->nblocks); ==== //depot/projects/uart/kern/kern_fork.c#9 (text+ko) ==== @@ -35,7 +35,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/kern/kern_fork.c,v 1.245 2004/11/20 02:28:48 das Exp $"); +__FBSDID("$FreeBSD: src/sys/kern/kern_fork.c,v 1.246 2004/11/20 23:00:59 das Exp $"); #include "opt_ktrace.h" #include "opt_mac.h" @@ -467,22 +467,19 @@ PROC_LOCK(p2); PROC_LOCK(p1); -#define RANGEOF(type, start, end) (offsetof(type, end) - offsetof(type, start)) - bzero(&p2->p_startzero, - (unsigned) RANGEOF(struct proc, p_startzero, p_endzero)); + __rangeof(struct proc, p_startzero, p_endzero)); bzero(&td2->td_startzero, - (unsigned) RANGEOF(struct thread, td_startzero, td_endzero)); + __rangeof(struct thread, td_startzero, td_endzero)); bzero(&kg2->kg_startzero, - (unsigned) RANGEOF(struct ksegrp, kg_startzero, kg_endzero)); + __rangeof(struct ksegrp, kg_startzero, kg_endzero)); bcopy(&p1->p_startcopy, &p2->p_startcopy, - (unsigned) RANGEOF(struct proc, p_startcopy, p_endcopy)); + __rangeof(struct proc, p_startcopy, p_endcopy)); bcopy(&td->td_startcopy, &td2->td_startcopy, - (unsigned) RANGEOF(struct thread, td_startcopy, td_endcopy)); + __rangeof(struct thread, td_startcopy, td_endcopy)); bcopy(&td->td_ksegrp->kg_startcopy, &kg2->kg_startcopy, - (unsigned) RANGEOF(struct ksegrp, kg_startcopy, kg_endcopy)); -#undef RANGEOF + __rangeof(struct ksegrp, kg_startcopy, kg_endcopy)); td2->td_sigstk = td->td_sigstk; ==== //depot/projects/uart/kern/kern_kse.c#2 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/kern/kern_kse.c,v 1.206 2004/10/07 13:50:10 davidxu Exp $"); +__FBSDID("$FreeBSD: src/sys/kern/kern_kse.c,v 1.207 2004/11/20 23:00:59 das Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -61,8 +61,6 @@ extern struct mtx kse_zombie_lock; -#define RANGEOF(type, start, end) (offsetof(type, end) - offsetof(type, start)) - TAILQ_HEAD(, kse_upcall) zombie_upcalls = TAILQ_HEAD_INITIALIZER(zombie_upcalls); @@ -600,10 +598,10 @@ if (uap->newgroup) { newkg = ksegrp_alloc(); - bzero(&newkg->kg_startzero, RANGEOF(struct ksegrp, - kg_startzero, kg_endzero)); + bzero(&newkg->kg_startzero, + __rangeof(struct ksegrp, kg_startzero, kg_endzero)); bcopy(&kg->kg_startcopy, &newkg->kg_startcopy, - RANGEOF(struct ksegrp, kg_startcopy, kg_endcopy)); + __rangeof(struct ksegrp, kg_startcopy, kg_endcopy)); sched_init_concurrency(newkg); PROC_LOCK(p); if (p->p_numksegrps >= max_groups_per_proc) { @@ -1033,7 +1031,7 @@ spare = thread_alloc(); td->td_standin = spare; bzero(&spare->td_startzero, - (unsigned) RANGEOF(struct thread, td_startzero, td_endzero)); + __rangeof(struct thread, td_startzero, td_endzero)); spare->td_proc = td->td_proc; spare->td_ucred = crhold(td->td_ucred); } @@ -1068,7 +1066,7 @@ * do the crhold here because we are in schedlock already. */ bcopy(&td->td_startcopy, &td2->td_startcopy, - (unsigned) RANGEOF(struct thread, td_startcopy, td_endcopy)); + __rangeof(struct thread, td_startcopy, td_endcopy)); thread_link(td2, ku->ku_ksegrp); /* inherit parts of blocked thread's context as a good template */ cpu_set_upcall(td2, td); ==== //depot/projects/uart/kern/kern_proc.c#9 (text+ko) ==== @@ -27,11 +27,11 @@ * SUCH DAMAGE. * * @(#)kern_proc.c 8.7 (Berkeley) 2/14/95 - * $FreeBSD: src/sys/kern/kern_proc.c,v 1.220 2004/11/20 02:28:48 das Exp $ + * $FreeBSD: src/sys/kern/kern_proc.c,v 1.221 2004/11/20 23:00:59 das Exp $ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/kern/kern_proc.c,v 1.220 2004/11/20 02:28:48 das Exp $"); +__FBSDID("$FreeBSD: src/sys/kern/kern_proc.c,v 1.221 2004/11/20 23:00:59 das Exp $"); #include "opt_ktrace.h" #include "opt_kstack_pages.h" @@ -827,13 +827,10 @@ pstats_fork(struct pstats *src, struct pstats *dst) { -#define RANGEOF(type, start, end) (offsetof(type, end) - offsetof(type, start)) - bzero(&dst->pstat_startzero, - (unsigned)RANGEOF(struct pstats, pstat_startzero, pstat_endzero)); + __rangeof(struct pstats, pstat_startzero, pstat_endzero)); bcopy(&src->pstat_startcopy, &dst->pstat_startcopy, - (unsigned)RANGEOF(struct pstats, pstat_startcopy, pstat_endcopy)); -#undef RANGEOF + __rangeof(struct pstats, pstat_startcopy, pstat_endcopy)); } void ==== //depot/projects/uart/kern/kern_switch.c#5 (text+ko) ==== @@ -86,7 +86,7 @@ ***/ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/kern/kern_switch.c,v 1.103 2004/11/07 23:11:32 rwatson Exp $"); +__FBSDID("$FreeBSD: src/sys/kern/kern_switch.c,v 1.104 2004/11/20 23:00:59 das Exp $"); #include "opt_sched.h" @@ -910,7 +910,6 @@ /****** functions that are temporarily here ***********/ #include <vm/uma.h> -#define RANGEOF(type, start, end) (offsetof(type, end) - offsetof(type, start)) extern struct mtx kse_zombie_lock; /* @@ -929,7 +928,6 @@ sched_init_concurrency(kg); } -#define RANGEOF(type, start, end) (offsetof(type, end) - offsetof(type, start)) /* * thread is being either created or recycled. * Fix up the per-scheduler resources associated with it. ==== //depot/projects/uart/kern/kern_thr.c#5 (text+ko) ==== @@ -25,7 +25,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/kern/kern_thr.c,v 1.29 2004/10/06 14:20:57 mtm Exp $"); +__FBSDID("$FreeBSD: src/sys/kern/kern_thr.c,v 1.30 2004/11/20 23:00:59 das Exp $"); #include <sys/param.h> #include <sys/kernel.h> @@ -58,12 +58,6 @@ &thr_concurrency, 0, "a concurrency value if not default"); /* - * Back end support functions. - */ - -#define RANGEOF(type, start, end) (offsetof(type, end) - offsetof(type, start)) - -/* * System call interface. */ int @@ -109,15 +103,15 @@ } bzero(&newtd->td_startzero, - (unsigned) RANGEOF(struct thread, td_startzero, td_endzero)); + __rangeof(struct thread, td_startzero, td_endzero)); bcopy(&td->td_startcopy, &newtd->td_startcopy, - (unsigned) RANGEOF(struct thread, td_startcopy, td_endcopy)); + __rangeof(struct thread, td_startcopy, td_endcopy)); if (scope_sys) { bzero(&newkg->kg_startzero, - (unsigned)RANGEOF(struct ksegrp, kg_startzero, kg_endzero)); + __rangeof(struct ksegrp, kg_startzero, kg_endzero)); bcopy(&kg->kg_startcopy, &newkg->kg_startcopy, - (unsigned)RANGEOF(struct ksegrp, kg_startcopy, kg_endcopy)); + __rangeof(struct ksegrp, kg_startcopy, kg_endcopy)); } newtd->td_proc = td->td_proc; ==== //depot/projects/uart/kern/kern_thread.c#13 (text+ko) ==== @@ -27,7 +27,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/kern/kern_thread.c,v 1.207 2004/11/05 22:40:33 davidxu Exp $"); +__FBSDID("$FreeBSD: src/sys/kern/kern_thread.c,v 1.208 2004/11/20 23:00:59 das Exp $"); #include <sys/param.h> #include <sys/systm.h> @@ -72,8 +72,6 @@ int virtual_cpu; -#define RANGEOF(type, start, end) (offsetof(type, end) - offsetof(type, start)) - TAILQ_HEAD(, thread) zombie_threads = TAILQ_HEAD_INITIALIZER(zombie_threads); TAILQ_HEAD(, ksegrp) zombie_ksegrps = TAILQ_HEAD_INITIALIZER(zombie_ksegrps); struct mtx kse_zombie_lock; ==== //depot/projects/uart/modules/sio/Makefile#2 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/modules/sio/Makefile,v 1.6 2004/05/26 00:53:08 imp Exp $ +# $FreeBSD: src/sys/modules/sio/Makefile,v 1.7 2004/11/20 23:04:32 marcel Exp $ .if ${MACHINE} == "pc98" .PATH: ${.CURDIR}/../../pc98/pc98 @@ -7,7 +7,7 @@ KMOD= sio SRCS= bus_if.h card_if.h device_if.h isa_if.h pci_if.h \ - opt_comconsole.h opt_compat.h opt_ddb.h opt_sio.h \ + opt_comconsole.h opt_compat.h opt_gdb.h opt_kdb.h opt_sio.h \ sio.c sio_pccard.c sio_pci.c sio_puc.c pccarddevs.h .if ${MACHINE} == "pc98" SRCS+= sio_cbus.c ==== //depot/projects/uart/modules/uart/Makefile#12 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/modules/uart/Makefile,v 1.12 2004/11/17 14:44:10 marius Exp $ +# $FreeBSD: src/sys/modules/uart/Makefile,v 1.13 2004/11/20 23:38:48 marcel Exp $ .PATH: ${.CURDIR}/../../dev/uart @@ -10,8 +10,8 @@ KMOD= uart SRCS= uart_bus_acpi.c ${uart_bus_ebus} uart_bus_isa.c uart_bus_pccard.c \ uart_bus_pci.c uart_bus_puc.c uart_core.c uart_cpu_${MACHINE}.c \ - uart_dbg.c uart_dev_i8251.c uart_dev_ns8250.c uart_dev_sab82532.c \ - uart_dev_z8530.c uart_if.c uart_subr.c uart_tty.c + uart_dbg.c uart_dev_ns8250.c uart_dev_sab82532.c uart_dev_z8530.c \ + uart_if.c uart_subr.c uart_tty.c SRCS+= bus_if.h card_if.h device_if.h isa_if.h ${ofw_bus_if} pci_if.h \ power_if.h uart_if.h pccarddevs.h
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200411210002.iAL02oA7006265>