Date: Tue, 6 Jan 2004 12:09:21 -0800 (PST) From: Sam Leffler <sam@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 44878 for review Message-ID: <200401062009.i06K9Lwl087584@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=44878 Change 44878 by sam@sam_ebb on 2004/01/06 12:08:33 IFC Affected files ... .. //depot/projects/netperf/sys/amd64/isa/atpic.c#3 integrate .. //depot/projects/netperf/sys/amd64/isa/icu.h#3 integrate .. //depot/projects/netperf/sys/boot/i386/boot0/Makefile#3 integrate .. //depot/projects/netperf/sys/boot/i386/boot0/boot0sio.s#3 integrate .. //depot/projects/netperf/sys/compat/ndis/kern_ndis.c#9 integrate .. //depot/projects/netperf/sys/compat/ndis/ndis_var.h#8 integrate .. //depot/projects/netperf/sys/compat/ndis/pe_var.h#2 integrate .. //depot/projects/netperf/sys/compat/ndis/subr_ndis.c#10 integrate .. //depot/projects/netperf/sys/compat/ndis/subr_ntoskrnl.c#6 integrate .. //depot/projects/netperf/sys/compat/ndis/subr_pe.c#4 integrate .. //depot/projects/netperf/sys/conf/options.pc98#7 integrate .. //depot/projects/netperf/sys/dev/drm/drmP.h#6 integrate .. //depot/projects/netperf/sys/dev/drm/drm_bufs.h#6 integrate .. //depot/projects/netperf/sys/dev/drm/drm_drv.h#6 integrate .. //depot/projects/netperf/sys/dev/drm/drm_sysctl.h#5 integrate .. //depot/projects/netperf/sys/dev/drm/mga_dma.c#5 integrate .. //depot/projects/netperf/sys/dev/drm/mga_drv.h#3 integrate .. //depot/projects/netperf/sys/dev/drm/r128.h#4 integrate .. //depot/projects/netperf/sys/dev/drm/r128_cce.c#5 integrate .. //depot/projects/netperf/sys/dev/drm/r128_drv.h#4 integrate .. //depot/projects/netperf/sys/dev/drm/radeon.h#6 integrate .. //depot/projects/netperf/sys/dev/drm/radeon_cp.c#6 integrate .. //depot/projects/netperf/sys/dev/drm/radeon_drv.h#5 integrate .. //depot/projects/netperf/sys/dev/firewire/firewire.c#9 integrate .. //depot/projects/netperf/sys/dev/firewire/firewirereg.h#5 integrate .. //depot/projects/netperf/sys/dev/firewire/fwmem.c#6 integrate .. //depot/projects/netperf/sys/dev/firewire/fwohci.c#9 integrate .. //depot/projects/netperf/sys/dev/firewire/fwohci_pci.c#7 integrate .. //depot/projects/netperf/sys/dev/firewire/fwohcireg.h#5 integrate .. //depot/projects/netperf/sys/dev/firewire/fwohcivar.h#3 integrate .. //depot/projects/netperf/sys/dev/firewire/if_fwe.c#10 integrate .. //depot/projects/netperf/sys/dev/firewire/sbp.c#12 integrate .. //depot/projects/netperf/sys/dev/ic/i8259.h#1 branch .. //depot/projects/netperf/sys/dev/if_ndis/if_ndis.c#9 integrate .. //depot/projects/netperf/sys/dev/usb/usbdevs#11 integrate .. //depot/projects/netperf/sys/dev/usb/usbdevs.h#11 integrate .. //depot/projects/netperf/sys/dev/usb/usbdevs_data.h#11 integrate .. //depot/projects/netperf/sys/i386/i386/elan-mmcr.c#7 integrate .. //depot/projects/netperf/sys/i386/i386/vm_machdep.c#9 integrate .. //depot/projects/netperf/sys/i386/include/elan_mmcr.h#1 branch .. //depot/projects/netperf/sys/i386/include/md_var.h#5 integrate .. //depot/projects/netperf/sys/i386/include/profile.h#2 integrate .. //depot/projects/netperf/sys/i386/isa/atpic.c#5 integrate .. //depot/projects/netperf/sys/i386/isa/icu.h#5 integrate .. //depot/projects/netperf/sys/kern/kern_lock.c#2 integrate .. //depot/projects/netperf/sys/kern/kern_mutex.c#4 integrate .. //depot/projects/netperf/sys/kern/vfs_subr.c#16 integrate .. //depot/projects/netperf/sys/pc98/conf/NOTES#10 integrate .. //depot/projects/netperf/sys/sys/vnode.h#8 integrate Differences ... ==== //depot/projects/netperf/sys/amd64/isa/atpic.c#3 (text+ko) ==== @@ -32,7 +32,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/amd64/isa/atpic.c,v 1.7 2003/11/21 02:58:26 peter Exp $"); +__FBSDID("$FreeBSD: src/sys/amd64/isa/atpic.c,v 1.8 2004/01/06 19:05:25 jhb Exp $"); #include "opt_auto_eoi.h" #include "opt_isa.h" @@ -53,6 +53,7 @@ #include <machine/resource.h> #include <machine/segments.h> +#include <dev/ic/i8259.h> #include <amd64/isa/icu.h> #include <amd64/isa/isa.h> ==== //depot/projects/netperf/sys/amd64/isa/icu.h#3 (text+ko) ==== @@ -34,7 +34,7 @@ * SUCH DAMAGE. * * from: @(#)icu.h 5.6 (Berkeley) 5/9/91 - * $FreeBSD: src/sys/amd64/isa/icu.h,v 1.31 2003/11/17 09:19:12 peter Exp $ + * $FreeBSD: src/sys/amd64/isa/icu.h,v 1.32 2004/01/06 19:05:25 jhb Exp $ */ /* @@ -42,8 +42,8 @@ * W. Jolitz 8/89 */ -#ifndef _I386_ISA_ICU_H_ -#define _I386_ISA_ICU_H_ +#ifndef _AMD64_ISA_ICU_H_ +#define _AMD64_ISA_ICU_H_ /* * Interrupt enable bits - in normal order of priority (which we change) @@ -66,57 +66,7 @@ #define IRQ6 0x0040 #define IRQ7 0x0080 /* lowest - parallel printer */ -/* Initialization control word 1. Written to even address. */ -#define ICW1_IC4 0x01 /* ICW4 present */ -#define ICW1_SNGL 0x02 /* 1 = single, 0 = cascaded */ -#define ICW1_ADI 0x04 /* 1 = 4, 0 = 8 byte vectors */ -#define ICW1_LTIM 0x08 /* 1 = level trigger, 0 = edge */ -#define ICW1_RESET 0x10 /* must be 1 */ -/* 0x20 - 0x80 - in 8080/8085 mode only */ - -/* Initialization control word 2. Written to the odd address. */ -/* No definitions, it is the base vector of the IDT for 8086 mode */ - -/* Initialization control word 3. Written to the odd address. */ -/* For a master PIC, bitfield indicating a slave 8259 on given input */ -/* For slave, lower 3 bits are the slave's ID binary id on master */ - -/* Initialization control word 4. Written to the odd address. */ -#define ICW4_8086 0x01 /* 1 = 8086, 0 = 8080 */ -#define ICW4_AEOI 0x02 /* 1 = Auto EOI */ -#define ICW4_MS 0x04 /* 1 = buffered master, 0 = slave */ -#define ICW4_BUF 0x08 /* 1 = enable buffer mode */ -#define ICW4_SFNM 0x10 /* 1 = special fully nested mode */ - -/* Operation control words. Written after initialization. */ - -/* Operation control word type 1 */ /* - * No definitions. Written to the odd address. Bitmask for interrupts. - * 1 = disabled. - */ - -/* Operation control word type 2. Bit 3 (0x08) must be zero. Even address. */ -#define OCW2_L0 0x01 /* Level */ -#define OCW2_L1 0x02 -#define OCW2_L2 0x04 -/* 0x08 must be 0 to select OCW2 vs OCW3 */ -/* 0x10 must be 0 to select OCW2 vs ICW1 */ -#define OCW2_EOI 0x20 /* 1 = EOI */ -#define OCW2_SL 0x40 /* EOI mode */ -#define OCW2_R 0x80 /* EOI mode */ - -/* Operation control word type 3. Bit 3 (0x08) must be set. Even address. */ -#define OCW3_RIS 0x01 /* 1 = read IS, 0 = read IR */ -#define OCW3_RR 0x02 /* register read */ -#define OCW3_P 0x04 /* poll mode command */ -/* 0x08 must be 1 to select OCW3 vs OCW2 */ -#define OCW3_SEL 0x08 /* must be 1 */ -/* 0x10 must be 0 to select OCW3 vs ICW1 */ -#define OCW3_SMM 0x20 /* special mode mask */ -#define OCW3_ESMM 0x40 /* enable SMM */ - -/* * Interrupt Control offset into Interrupt descriptor table (IDT) */ #define ICU_OFFSET 32 /* 0-31 are processor exceptions */ @@ -130,4 +80,4 @@ void atpic_startup(void); #endif -#endif /* !_I386_ISA_ICU_H_ */ +#endif /* !_AMD64_ISA_ICU_H_ */ ==== //depot/projects/netperf/sys/boot/i386/boot0/Makefile#3 (text+ko) ==== @@ -1,4 +1,4 @@ -# $FreeBSD: src/sys/boot/i386/boot0/Makefile,v 1.19 2003/12/08 19:02:06 obrien Exp $ +# $FreeBSD: src/sys/boot/i386/boot0/Makefile,v 1.20 2004/01/06 18:46:35 obrien Exp $ PROG?= boot0 NOMAN= @@ -23,13 +23,21 @@ # unless you are glutton for punishment. BOOT_BOOT0_ORG?= 0x600 +# Comm settings for boot0sio. 0xE3 => 9600 8-N-1 +# XXX: We should create a build-tool or something to convert BOOT_CONSOLE_SPEED +# and BOOT_COMCONSOLE_PORT into the correct values to define on the build +# command line +BOOT_BOOT0_COMCONSOLE_SPEED?= 0xE3 + ${PROG}: ${PROG}.o ${LD} -N -e start -Ttext ${BOOT_BOOT0_ORG} -o ${PROG}.out ${PROG}.o objcopy -S -O binary ${PROG}.out ${.TARGET} ${PROG}.o: ${PROG}.s ${AS} ${AFLAGS} --defsym FLAGS=${BOOT_BOOT0_FLAGS} \ - --defsym TICKS=${BOOT_BOOT0_TICKS} ${.IMPSRC} -o ${.TARGET} + --defsym TICKS=${BOOT_BOOT0_TICKS} \ + --defsym COMSPEED=${BOOT_BOOT0_COMCONSOLE_SPEED} \ + ${.IMPSRC} -o ${.TARGET} CLEANFILES+= ${PROG}.out ${PROG}.o ==== //depot/projects/netperf/sys/boot/i386/boot0/boot0sio.s#3 (text+ko) ==== @@ -14,7 +14,7 @@ # purpose. # -# $FreeBSD: src/sys/boot/i386/boot0/boot0sio.s,v 1.2 2003/12/09 05:40:06 obrien Exp $ +# $FreeBSD: src/sys/boot/i386/boot0/boot0sio.s,v 1.3 2004/01/06 18:46:35 obrien Exp $ # A 512-byte boot manager which uses a serial console on COM1. @@ -95,8 +95,7 @@ # main: pushw %dx # Save xorw %dx,%dx # Port: COM1 - movb $0xE3,%al # 9600 8-N-1 - + movb COMSPEED,%al # defined by Makefile movb $0x00,%ah # BIOS: Set COM Port int $0x14 # Parameters popw %dx # Restore ==== //depot/projects/netperf/sys/compat/ndis/kern_ndis.c#9 (text+ko) ==== @@ -31,7 +31,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/compat/ndis/kern_ndis.c,v 1.21 2004/01/04 21:22:25 wpaul Exp $"); +__FBSDID("$FreeBSD: src/sys/compat/ndis/kern_ndis.c,v 1.22 2004/01/06 07:09:26 wpaul Exp $"); #include <sys/param.h> #include <sys/types.h> @@ -1179,6 +1179,7 @@ block->nmb_ifp = &sc->arpcom.ac_if; block->nmb_dev = sc->ndis_dev; + block->nmb_img = img; return(0); } ==== //depot/projects/netperf/sys/compat/ndis/ndis_var.h#8 (text+ko) ==== @@ -29,7 +29,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/compat/ndis/ndis_var.h,v 1.11 2004/01/04 07:47:33 wpaul Exp $ + * $FreeBSD: src/sys/compat/ndis/ndis_var.h,v 1.12 2004/01/06 07:09:26 wpaul Exp $ */ #ifndef _NDIS_VAR_H_ @@ -1280,6 +1280,7 @@ ndis_status nmb_getstat; ndis_status nmb_setstat; struct nte_head nmb_timerlist; + vm_offset_t nmb_img; }; typedef ndis_status (*ndis_init_handler)(ndis_status *, uint32_t *, ==== //depot/projects/netperf/sys/compat/ndis/pe_var.h#2 (text+ko) ==== @@ -29,7 +29,7 @@ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF * THE POSSIBILITY OF SUCH DAMAGE. * - * $FreeBSD: src/sys/compat/ndis/pe_var.h,v 1.1 2003/12/11 22:34:37 wpaul Exp $ + * $FreeBSD: src/sys/compat/ndis/pe_var.h,v 1.3 2004/01/06 18:06:54 wpaul Exp $ */ #ifndef _PE_VAR_H_ @@ -230,6 +230,29 @@ #define IMAGE_DIRECTORY_ENTRY_DELAY_IMPORT 13 #define IMAGE_DIRECTORY_ENTRY_COM_DESCRIPTOR 14 +/* Resource types */ + +#define RT_CURSOR 1 +#define RT_BITMAP 2 +#define RT_ICON 3 +#define RT_MENU 4 +#define RT_DIALOG 5 +#define RT_STRING 6 +#define RT_FONTDIR 7 +#define RT_FONT 8 +#define RT_ACCELERATOR 9 +#define RT_RCDATA 10 +#define RT_MESSAGETABLE 11 +#define RT_GROUP_CURSOR 12 +#define RT_GROUP_ICON 14 +#define RT_VERSION 16 +#define RT_DLGINCLUDE 17 +#define RT_PLUGPLAY 19 +#define RT_VXD 20 +#define RT_ANICURSOR 21 +#define RT_ANIICON 22 +#define RT_HTML 23 + /* * Section header format. */ @@ -303,7 +326,81 @@ #define IMAGE_REL_BASED_DIR64 10 #define IMAGE_REL_BASED_HIGH3ADJ 11 +struct image_resource_directory_entry { + uint32_t irde_name; + uint32_t irde_dataoff; +}; +typedef struct image_resource_directory_entry image_resource_directory_entry; + +#define RESOURCE_NAME_STR 0x80000000 +#define RESOURCE_DIR_FLAG 0x80000000 + +struct image_resource_directory { + uint32_t ird_characteristics; + uint32_t ird_timestamp; + uint16_t ird_majorver; + uint16_t ird_minorver; + uint16_t ird_named_entries; + uint16_t ird_id_entries; +#ifdef notdef + image_resource_directory_entry ird_entries[1]; +#endif +}; + +typedef struct image_resource_directory image_resource_directory; + +struct image_resource_directory_string { + uint16_t irds_len; + char irds_name[1]; +}; + +typedef struct image_resource_directory_string image_resource_directory_string; + +struct image_resource_directory_string_u { + uint16_t irds_len; + char irds_name[1]; +}; + +typedef struct image_resource_directory_string_u + image_resource_directory_string_u; + +struct image_resource_data_entry { + uint32_t irde_offset; + uint32_t irde_size; + uint32_t irde_codepage; + uint32_t irde_rsvd; +}; + +typedef struct image_resource_data_entry image_resource_data_entry; + +struct message_resource_data { + uint32_t mrd_numblocks; +#ifdef notdef + message_resource_block mrd_blocks[1]; +#endif +}; + +typedef struct message_resource_data message_resource_data; + +struct message_resource_block { + uint32_t mrb_lowid; + uint32_t mrb_highid; + uint32_t mrb_entryoff; +}; + +typedef struct message_resource_block message_resource_block; + +struct message_resource_entry { + uint16_t mre_len; + uint16_t mre_flags; + char mre_text[]; +}; + +typedef struct message_resource_entry message_resource_entry; + +#define MESSAGE_RESOURCE_UNICODE 0x0001 + struct image_patch_table { char *ipt_name; void (*ipt_func)(void); @@ -325,6 +422,8 @@ extern int pe_relocate(vm_offset_t); extern int pe_get_import_descriptor(vm_offset_t, image_import_descriptor *, char *); extern int pe_patch_imports(vm_offset_t, char *, image_patch_table *); +extern int pe_get_messagetable(vm_offset_t, message_resource_data **); +extern int pe_get_message(vm_offset_t, uint32_t, char **, int *, uint16_t *); __END_DECLS #endif /* _PE_VAR_H_ */ ==== //depot/projects/netperf/sys/compat/ndis/subr_ndis.c#10 (text+ko) ==== @@ -31,7 +31,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/compat/ndis/subr_ndis.c,v 1.25 2004/01/04 21:22:25 wpaul Exp $"); +__FBSDID("$FreeBSD: src/sys/compat/ndis/subr_ndis.c,v 1.27 2004/01/06 18:06:54 wpaul Exp $"); /* * This file implements a translation layer between the BSD networking @@ -795,11 +795,19 @@ { ndis_miniport_block *block; va_list ap; - int i; + int i, error; + char *str = NULL, *ustr = NULL; + uint16_t flags; block = (ndis_miniport_block *)adapter; - device_printf (block->nmb_dev, "NDIS ERROR: %x\n", code); + error = pe_get_message(block->nmb_img, code, &str, &i, &flags); + if (error == 0 && flags & MESSAGE_RESOURCE_UNICODE) { + ndis_unicode_to_ascii((uint16_t *)str, i, &ustr); + str = ustr; + } + device_printf (block->nmb_dev, "NDIS ERROR: %x (%s)\n", code, + str == NULL ? "unknown error" : str); device_printf (block->nmb_dev, "NDIS NUMERRORS: %x\n", numerrors); va_start(ap, numerrors); @@ -808,6 +816,8 @@ va_arg(ap, void *)); va_end(ap); + if (ustr != NULL) + free(ustr, M_DEVBUF); return; } @@ -1894,7 +1904,14 @@ uint8_t shared; ndis_interrupt_mode imode; { + ndis_miniport_block *block; + + block = adapter; + intr->ni_block = adapter; + intr->ni_isrreq = reqisr; + intr->ni_shared = shared; + block->nmb_interrupt = intr; return(NDIS_STATUS_SUCCESS); } ==== //depot/projects/netperf/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.7 2004/01/04 07:47:33 wpaul Exp $"); +__FBSDID("$FreeBSD: src/sys/compat/ndis/subr_ntoskrnl.c,v 1.8 2004/01/06 07:09:26 wpaul Exp $"); #include <sys/param.h> #include <sys/types.h> @@ -59,6 +59,8 @@ #include <compat/ndis/ntoskrnl_var.h> #define __stdcall __attribute__((__stdcall__)) +#define __regparm __attribute__((regparm(3))) + #define FUNC void(*)(void) __stdcall static uint32_t ntoskrnl_unicode_equal(ndis_unicode_string *, @@ -82,13 +84,13 @@ __stdcall static int64_t _allmul(int64_t, int64_t); __stdcall static int64_t _alldiv(int64_t, int64_t); __stdcall static int64_t _allrem(int64_t, int64_t); -__stdcall static int64_t _allshr(int64_t, int); -__stdcall static int64_t _allshl(int64_t, int); +__regparm static int64_t _allshr(int64_t, uint8_t); +__regparm static int64_t _allshl(int64_t, uint8_t); __stdcall static uint64_t _aullmul(uint64_t, uint64_t); __stdcall static uint64_t _aulldiv(uint64_t, uint64_t); __stdcall static uint64_t _aullrem(uint64_t, uint64_t); -__stdcall static uint64_t _aullshr(uint64_t, int); -__stdcall static uint64_t _aullshl(uint64_t, int); +__regparm static uint64_t _aullshr(uint64_t, uint8_t); +__regparm static uint64_t _aullshl(uint64_t, uint8_t); __stdcall static void *ntoskrnl_allocfunc(uint32_t, size_t, uint32_t); __stdcall static void ntoskrnl_freefunc(void *); __stdcall static void ntoskrnl_init_lookaside(paged_lookaside_list *, @@ -108,11 +110,13 @@ kspin_lock * */void); __stdcall static void ntoskrnl_lock_dpc(/*kspin_lock * */ void); __stdcall static void ntoskrnl_unlock_dpc(/*kspin_lock * */ void); -__stdcall static void ntoskrnl_interlock_inc(/*volatile uint32_t * */ void); -__stdcall static void ntoskrnl_interlock_dec(/*volatile uint32_t * */ void); +__stdcall static uint32_t + ntoskrnl_interlock_inc(/*volatile uint32_t * */ void); +__stdcall static uint32_t + ntoskrnl_interlock_dec(/*volatile uint32_t * */ void); __stdcall static void ntoskrnl_freemdl(ndis_buffer *); __stdcall static void *ntoskrnl_mmaplockedpages(ndis_buffer *, uint8_t); -__stdcall static void ntoskrnl_create_lock(kspin_lock *); +__stdcall static void ntoskrnl_init_lock(kspin_lock *); __stdcall static void dummy(void); __stdcall static size_t ntoskrnl_memcmp(const void *, const void *, size_t); @@ -121,7 +125,7 @@ int ntoskrnl_libinit() { - mtx_init(&ntoskrnl_interlock, "ntoskrnllock", MTX_NETWORK_LOCK, + mtx_init(&ntoskrnl_interlock, "ntoskrnllock", "ntoskrnl interlock", MTX_DEF | MTX_RECURSE); return(0); @@ -333,34 +337,34 @@ return (a % b); } -__stdcall static int64_t +__regparm static int64_t _allshl(a, b) int64_t a; - int b; + uint8_t b; { return (a << b); } -__stdcall static uint64_t +__regparm static uint64_t _aullshl(a, b) uint64_t a; - int b; + uint8_t b; { return (a << b); } -__stdcall static int64_t +__regparm static int64_t _allshr(a, b) int64_t a; - int b; + uint8_t b; { return (a >> b); } -__stdcall static uint64_t +__regparm static uint64_t _aullshr(a, b) uint64_t a; - int b; + uint8_t b; { return (a >> b); } @@ -567,7 +571,7 @@ return; } -__stdcall static void +__stdcall static uint32_t ntoskrnl_interlock_inc(/*addend*/ void) { volatile uint32_t *addend; @@ -578,10 +582,10 @@ (*addend)++; mtx_unlock(&ntoskrnl_interlock); - return; + return(*addend); } -__stdcall static void +__stdcall static uint32_t ntoskrnl_interlock_dec(/*addend*/ void) { volatile uint32_t *addend; @@ -592,7 +596,7 @@ (*addend)--; mtx_unlock(&ntoskrnl_interlock); - return; + return(*addend); } __stdcall static void @@ -623,20 +627,20 @@ return(MDL_VA(buf)); } +/* + * The KeInitializeSpinLock(), KefAcquireSpinLockAtDpcLevel() + * and KefReleaseSpinLockFromDpcLevel() appear to be analagous + * to splnet()/splx() in their use. We can't create a new mutex + * lock here because there is no complimentary KeFreeSpinLock() + * function. For now, what we do is initialize the lock with + * a pointer to the ntoskrnl interlock mutex. + */ __stdcall static void -ntoskrnl_create_lock(lock) +ntoskrnl_init_lock(lock) kspin_lock *lock; { - struct mtx *mtx; + *lock = (kspin_lock)&ntoskrnl_interlock; - mtx = malloc(sizeof(struct mtx), M_DEVBUF, M_NOWAIT|M_ZERO); - if (mtx == NULL) - return; - mtx_init(mtx, "ntoslock", "ntoskrnl spinlock", - MTX_DEF | MTX_RECURSE | MTX_DUPOK); - - *lock = (kspin_lock)mtx; - return; } @@ -715,7 +719,7 @@ { "InterlockedDecrement", (FUNC)ntoskrnl_interlock_dec }, { "IoFreeMdl", (FUNC)ntoskrnl_freemdl }, { "MmMapLockedPages", (FUNC)ntoskrnl_mmaplockedpages }, - { "KeInitializeSpinLock", (FUNC)ntoskrnl_create_lock }, + { "KeInitializeSpinLock", (FUNC)ntoskrnl_init_lock }, /* * This last entry is a catch-all for any function we haven't ==== //depot/projects/netperf/sys/compat/ndis/subr_pe.c#4 (text+ko) ==== @@ -31,7 +31,7 @@ */ #include <sys/cdefs.h> -__FBSDID("$FreeBSD: src/sys/compat/ndis/subr_pe.c,v 1.3 2003/12/26 03:31:34 wpaul Exp $"); +__FBSDID("$FreeBSD: src/sys/compat/ndis/subr_pe.c,v 1.5 2004/01/06 18:06:54 wpaul Exp $"); /* * This file contains routines for relocating and dynamically linking @@ -456,6 +456,91 @@ return (ENOENT); } +int +pe_get_messagetable(imgbase, md) + vm_offset_t imgbase; + message_resource_data **md; +{ + image_resource_directory *rdir, *rtype; + image_resource_directory_entry *dent, *dent2; + image_resource_data_entry *rent; + vm_offset_t offset; + int i; + + if (imgbase == 0) + return(EINVAL); + + offset = pe_directory_offset(imgbase, IMAGE_DIRECTORY_ENTRY_RESOURCE); + if (offset == 0) + return (ENOENT); + + rdir = (image_resource_directory *)offset; + + dent = (image_resource_directory_entry *)(offset + + sizeof(image_resource_directory)); + + for (i = 0; i < rdir->ird_id_entries; i++){ + if (dent->irde_name != RT_MESSAGETABLE) { + dent++; + continue; + } + dent2 = dent; + while (dent2->irde_dataoff & RESOURCE_DIR_FLAG) { + rtype = (image_resource_directory *)(offset + + (dent2->irde_dataoff & ~RESOURCE_DIR_FLAG)); + dent2 = (image_resource_directory_entry *) + ((uintptr_t)rtype + + sizeof(image_resource_directory)); + } + rent = (image_resource_data_entry *)(offset + + dent2->irde_dataoff); + *md = (message_resource_data *)pe_translate_addr(imgbase, + rent->irde_offset); + return(0); + } + + return(ENOENT); +} + +int +pe_get_message(imgbase, id, str, len, flags) + vm_offset_t imgbase; + uint32_t id; + char **str; + int *len; + uint16_t *flags; +{ + message_resource_data *md = NULL; + message_resource_block *mb; + message_resource_entry *me; + uint32_t i; + + pe_get_messagetable(imgbase, &md); + + if (md == NULL) + return(ENOENT); + + mb = (message_resource_block *)((uintptr_t)md + + sizeof(message_resource_data)); + + for (i = 0; i < md->mrd_numblocks; i++) { + if (id >= mb->mrb_lowid && id <= mb->mrb_highid) { + me = (message_resource_entry *)((uintptr_t)md + + mb->mrb_entryoff); + for (i = id - mb->mrb_lowid; i > 0; i--) + me = (message_resource_entry *)((uintptr_t)me + + me->mre_len); + *str = me->mre_text; + *len = me->mre_len; + *flags = me->mre_flags; + return(0); + } + mb++; + } + + return(ENOENT); +} + /* * Find the function that matches a particular name. This doesn't * need to be particularly speedy since it's only run when loading ==== //depot/projects/netperf/sys/conf/options.pc98#7 (text+ko) ==== @@ -1,8 +1,7 @@ -# $FreeBSD: src/sys/conf/options.pc98,v 1.172 2003/12/30 07:28:54 bde Exp $ +# $FreeBSD: src/sys/conf/options.pc98,v 1.173 2004/01/06 18:51:14 jhb Exp $ # Options specific to the pc98 platform kernels AUTO_EOI_1 opt_auto_eoi.h -AUTO_EOI_2 opt_auto_eoi.h BROKEN_KEYBOARD_RESET opt_reset.h COMPAT_OLDISA I586_PMC_GUPROF opt_i586_guprof.h ==== //depot/projects/netperf/sys/dev/drm/drmP.h#6 (text+ko) ==== @@ -28,7 +28,7 @@ * Rickard E. (Rik) Faith <faith@valinux.com> * Gareth Hughes <gareth@valinux.com> * - * $FreeBSD: src/sys/dev/drm/drmP.h,v 1.8 2003/11/12 20:56:30 anholt Exp $ + * $FreeBSD: src/sys/dev/drm/drmP.h,v 1.9 2004/01/06 04:34:52 anholt Exp $ */ #ifndef _DRM_P_H_ @@ -268,7 +268,7 @@ int enabled; int acquired; unsigned long base; - int agp_mtrr; + int mtrr; int cant_use_aperture; unsigned long page_mask; } drm_agp_head_t; @@ -288,7 +288,7 @@ drm_map_flags_t flags; /* Flags */ void *handle; /* User-space: "Handle" to pass to mmap */ /* Kernel-space: kernel-virtual address */ - int mtrr; /* MTRR slot used */ + int mtrr; /* Boolean: MTRR used */ /* Private data */ bus_space_tag_t iot; bus_space_handle_t ioh; ==== //depot/projects/netperf/sys/dev/drm/drm_bufs.h#6 (text+ko) ==== @@ -28,7 +28,7 @@ * Rickard E. (Rik) Faith <faith@valinux.com> * Gareth Hughes <gareth@valinux.com> * - * $FreeBSD: src/sys/dev/drm/drm_bufs.h,v 1.9 2003/12/23 14:38:42 se Exp $ + * $FreeBSD: src/sys/dev/drm/drm_bufs.h,v 1.10 2004/01/06 04:34:52 anholt Exp $ */ #include "dev/drm/drmP.h" @@ -88,7 +88,7 @@ map->size = request.size; map->type = request.type; map->flags = request.flags; - map->mtrr = -1; + map->mtrr = 0; map->handle = 0; /* Only allow shared memory to be removable since we only keep enough @@ -105,28 +105,23 @@ DRM(free)( map, sizeof(*map), DRM_MEM_MAPS ); return DRM_ERR(EINVAL); } + if (map->offset + map->size < map->offset) { + DRM(free)(map, sizeof(*map), DRM_MEM_MAPS); + return DRM_ERR(EINVAL); + } switch ( map->type ) { case _DRM_REGISTERS: + DRM_IOREMAP(map, dev); + if (!(map->flags & _DRM_WRITE_COMBINING)) + break; + /* FALLTHROUGH */ case _DRM_FRAME_BUFFER: - if ( map->offset + map->size < map->offset ) { - DRM(free)( map, sizeof(*map), DRM_MEM_MAPS ); - return DRM_ERR(EINVAL); - } #if __REALLY_HAVE_MTRR - if ( map->type == _DRM_FRAME_BUFFER || - (map->flags & _DRM_WRITE_COMBINING) ) { - int mtrr; - - mtrr = DRM(mtrr_add)(map->offset, map->size, - DRM_MTRR_WC); - if (mtrr == 0) - map->mtrr = 1; - } -#endif /* __REALLY_HAVE_MTRR */ - DRM_IOREMAP(map, dev); + if (DRM(mtrr_add)(map->offset, map->size, DRM_MTRR_WC) == 0) + map->mtrr = 1; +#endif break; - case _DRM_SHM: map->handle = (void *)DRM(alloc)(map->size, DRM_MEM_SAREA); DRM_DEBUG( "%lu %d %p\n", @@ -153,7 +148,7 @@ #if __REALLY_HAVE_AGP case _DRM_AGP: map->offset += dev->agp->base; - map->mtrr = dev->agp->agp_mtrr; /* for getmap */ + map->mtrr = dev->agp->mtrr; /* for getmap */ break; #endif case _DRM_SCATTER_GATHER: @@ -232,12 +227,12 @@ case _DRM_REGISTERS: case _DRM_FRAME_BUFFER: #if __REALLY_HAVE_MTRR - if (map->mtrr >= 0) { - int __unused mtrr; + if (map->mtrr) { + int __unused retcode; - mtrr = DRM(mtrr_del)(map->offset, map->size, + retcode = DRM(mtrr_del)(map->offset, map->size, DRM_MTRR_WC); - DRM_DEBUG("mtrr_del = %d\n", mtrr); + DRM_DEBUG("mtrr_del = %d\n", retcode); } #endif DRM(ioremapfree)(map); ==== //depot/projects/netperf/sys/dev/drm/drm_drv.h#6 (text+ko) ==== @@ -28,7 +28,7 @@ * Rickard E. (Rik) Faith <faith@valinux.com> * Gareth Hughes <gareth@valinux.com> * - * $FreeBSD: src/sys/dev/drm/drm_drv.h,v 1.17 2003/11/12 20:56:30 anholt Exp $ + * $FreeBSD: src/sys/dev/drm/drm_drv.h,v 1.18 2004/01/06 04:34:52 anholt Exp $ */ /* @@ -566,17 +566,18 @@ map = list->map; switch ( map->type ) { case _DRM_REGISTERS: + DRM(ioremapfree)(map); + /* FALLTHROUGH */ case _DRM_FRAME_BUFFER: #if __REALLY_HAVE_MTRR - if ( map->mtrr >= 0 ) { - int __unused mtrr; + if (map->mtrr) { + int __unused retcode; - mtrr = DRM(mtrr_del)(map->offset, + retcode = DRM(mtrr_del)(map->offset, map->size, DRM_MTRR_WC); - DRM_DEBUG("mtrr_del=%d\n", mtrr); + DRM_DEBUG("mtrr_del = %d", retcode); } #endif - DRM(ioremapfree)( map ); break; case _DRM_SHM: DRM(free)(map->handle, @@ -680,12 +681,9 @@ #endif /* __MUST_HAVE_AGP */ #if __REALLY_HAVE_MTRR if (dev->agp) { - int retcode; - - retcode = DRM(mtrr_add)(dev->agp->info.ai_aperture_base, - dev->agp->info.ai_aperture_size, DRM_MTRR_WC); - if (retcode == 0) - dev->agp->agp_mtrr=1; + if (DRM(mtrr_add)(dev->agp->info.ai_aperture_base, + dev->agp->info.ai_aperture_size, DRM_MTRR_WC) == 0) + dev->agp->mtrr = 1; } #endif /* __REALLY_HAVE_MTRR */ #endif /* __REALLY_HAVE_AGP */ @@ -743,12 +741,12 @@ #endif #if __REALLY_HAVE_AGP && __REALLY_HAVE_MTRR - if ( dev->agp && dev->agp->agp_mtrr >= 0) { - int __unused mtrr; + if (dev->agp && dev->agp->mtrr) { + int __unused retcode; - mtrr = DRM(mtrr_del)(dev->agp->info.ai_aperture_base, + retcode = DRM(mtrr_del)(dev->agp->info.ai_aperture_base, dev->agp->info.ai_aperture_size, DRM_MTRR_WC); - DRM_DEBUG("mtrr_del=%d\n", mtrr); + DRM_DEBUG("mtrr_del = %d", retcode); } #endif ==== //depot/projects/netperf/sys/dev/drm/drm_sysctl.h#5 (text+ko) ==== @@ -21,7 +21,7 @@ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. * - * $FreeBSD: src/sys/dev/drm/drm_sysctl.h,v 1.6 2003/10/24 21:45:21 anholt Exp $ + * $FreeBSD: src/sys/dev/drm/drm_sysctl.h,v 1.7 2004/01/06 04:34:52 anholt Exp $ */ #ifdef __FreeBSD__ @@ -194,7 +194,7 @@ else type = types[map->type]; - if (map->mtrr <= 0) + if (!map->mtrr) yesno = "no"; else yesno = "yes"; ==== //depot/projects/netperf/sys/dev/drm/mga_dma.c#5 (text+ko) ==== @@ -32,7 +32,7 @@ * Rewritten by: * Gareth Hughes <gareth@valinux.com> * - * $FreeBSD: src/sys/dev/drm/mga_dma.c,v 1.9 2003/11/12 20:56:30 anholt Exp $ + * $FreeBSD: src/sys/dev/drm/mga_dma.c,v 1.10 2004/01/06 04:34:53 anholt Exp $ */ #include "dev/drm/mga.h" @@ -502,14 +502,6 @@ return DRM_ERR(EINVAL); } - DRM_FIND_MAP( dev_priv->fb, init->fb_offset ); - if(!dev_priv->fb) { - DRM_ERROR( "failed to find framebuffer!\n" ); - /* Assign dev_private so we can do cleanup. */ - dev->dev_private = (void *)dev_priv; - mga_do_cleanup_dma( dev ); - return DRM_ERR(EINVAL); - } DRM_FIND_MAP( dev_priv->mmio, init->mmio_offset ); if(!dev_priv->mmio) { DRM_ERROR( "failed to find mmio region!\n" ); ==== //depot/projects/netperf/sys/dev/drm/mga_drv.h#3 (text+ko) ==== @@ -27,7 +27,7 @@ * Authors: * Gareth Hughes <gareth@valinux.com> * - * $FreeBSD: src/sys/dev/drm/mga_drv.h,v 1.6 2003/08/19 02:57:31 anholt Exp $ + * $FreeBSD: src/sys/dev/drm/mga_drv.h,v 1.7 2004/01/06 04:34:53 anholt Exp $ */ #ifndef __MGA_DRV_H__ @@ -93,7 +93,6 @@ unsigned int texture_size; drm_local_map_t *sarea; - drm_local_map_t *fb; drm_local_map_t *mmio; drm_local_map_t *status; drm_local_map_t *warp; >>> TRUNCATED FOR MAIL (1000 lines) <<<
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200401062009.i06K9Lwl087584>