PERFORCE change 44923 for review
Warner Losh
imp at FreeBSD.org
Wed Jan 7 15:45:28 PST 2004
http://perforce.freebsd.org/chv.cgi?CH=44923
Change 44923 by imp at imp_pacopaco on 2004/01/07 15:41:46
IFC @44918
Affected files ...
.. //depot/projects/power/sys/amd64/include/profile.h#2 integrate
.. //depot/projects/power/sys/amd64/isa/atpic.c#3 integrate
.. //depot/projects/power/sys/amd64/isa/icu.h#3 integrate
.. //depot/projects/power/sys/boot/i386/boot0/Makefile#3 integrate
.. //depot/projects/power/sys/boot/i386/boot0/boot0sio.s#2 integrate
.. //depot/projects/power/sys/compat/ndis/kern_ndis.c#3 integrate
.. //depot/projects/power/sys/compat/ndis/ndis_var.h#3 integrate
.. //depot/projects/power/sys/compat/ndis/pe_var.h#2 integrate
.. //depot/projects/power/sys/compat/ndis/subr_ndis.c#3 integrate
.. //depot/projects/power/sys/compat/ndis/subr_ntoskrnl.c#3 integrate
.. //depot/projects/power/sys/compat/ndis/subr_pe.c#2 integrate
.. //depot/projects/power/sys/conf/options.pc98#4 integrate
.. //depot/projects/power/sys/dev/ath/if_ath.c#6 integrate
.. //depot/projects/power/sys/dev/drm/drmP.h#4 integrate
.. //depot/projects/power/sys/dev/drm/drm_bufs.h#5 integrate
.. //depot/projects/power/sys/dev/drm/drm_drv.h#4 integrate
.. //depot/projects/power/sys/dev/drm/drm_sysctl.h#3 integrate
.. //depot/projects/power/sys/dev/drm/mga_dma.c#4 integrate
.. //depot/projects/power/sys/dev/drm/mga_drv.h#2 integrate
.. //depot/projects/power/sys/dev/drm/r128.h#3 integrate
.. //depot/projects/power/sys/dev/drm/r128_cce.c#4 integrate
.. //depot/projects/power/sys/dev/drm/r128_drv.h#3 integrate
.. //depot/projects/power/sys/dev/drm/radeon.h#4 integrate
.. //depot/projects/power/sys/dev/drm/radeon_cp.c#4 integrate
.. //depot/projects/power/sys/dev/drm/radeon_drv.h#3 integrate
.. //depot/projects/power/sys/dev/firewire/firewire.c#6 integrate
.. //depot/projects/power/sys/dev/firewire/firewirereg.h#5 integrate
.. //depot/projects/power/sys/dev/firewire/fwmem.c#6 integrate
.. //depot/projects/power/sys/dev/firewire/fwohci.c#6 integrate
.. //depot/projects/power/sys/dev/firewire/fwohci_pci.c#6 integrate
.. //depot/projects/power/sys/dev/firewire/fwohcireg.h#4 integrate
.. //depot/projects/power/sys/dev/firewire/fwohcivar.h#4 integrate
.. //depot/projects/power/sys/dev/firewire/if_fwe.c#5 integrate
.. //depot/projects/power/sys/dev/firewire/sbp.c#5 integrate
.. //depot/projects/power/sys/dev/ic/i8259.h#1 branch
.. //depot/projects/power/sys/dev/if_ndis/if_ndis.c#3 integrate
.. //depot/projects/power/sys/dev/usb/usbdevs#6 integrate
.. //depot/projects/power/sys/dev/usb/usbdevs.h#6 integrate
.. //depot/projects/power/sys/dev/usb/usbdevs_data.h#6 integrate
.. //depot/projects/power/sys/fs/procfs/procfs.c#3 integrate
.. //depot/projects/power/sys/i386/i386/elan-mmcr.c#5 integrate
.. //depot/projects/power/sys/i386/i386/vm_machdep.c#5 integrate
.. //depot/projects/power/sys/i386/include/elan_mmcr.h#1 branch
.. //depot/projects/power/sys/i386/include/md_var.h#4 integrate
.. //depot/projects/power/sys/i386/include/profile.h#2 integrate
.. //depot/projects/power/sys/i386/isa/atpic.c#2 integrate
.. //depot/projects/power/sys/i386/isa/icu.h#3 integrate
.. //depot/projects/power/sys/i386/isa/pcvt/pcvt_ext.c#2 integrate
.. //depot/projects/power/sys/kern/kern_lock.c#2 integrate
.. //depot/projects/power/sys/kern/kern_mutex.c#3 integrate
.. //depot/projects/power/sys/kern/vfs_subr.c#8 integrate
.. //depot/projects/power/sys/netinet/ip_icmp.c#5 integrate
.. //depot/projects/power/sys/netinet/tcp_input.c#6 integrate
.. //depot/projects/power/sys/netinet/tcp_subr.c#7 integrate
.. //depot/projects/power/sys/pc98/conf/NOTES#4 integrate
.. //depot/projects/power/sys/sys/vnode.h#6 integrate
.. //depot/projects/power/sys/vm/vm_contig.c#3 integrate
.. //depot/projects/power/sys/vm/vm_kern.c#5 integrate
Differences ...
==== //depot/projects/power/sys/amd64/include/profile.h#2 (text+ko) ====
@@ -31,7 +31,7 @@
* SUCH DAMAGE.
*
* @(#)profile.h 8.1 (Berkeley) 6/11/93
- * $FreeBSD: src/sys/amd64/include/profile.h,v 1.32 2003/06/02 00:28:39 obrien Exp $
+ * $FreeBSD: src/sys/amd64/include/profile.h,v 1.33 2004/01/06 20:36:21 nectar Exp $
*/
#ifndef _MACHINE_PROFILE_H_
@@ -148,7 +148,6 @@
#ifdef __GNUC__
void mcount(void) __asm(".mcount");
#endif
-static void _mcount(uintfptr_t frompc, uintfptr_t selfpc);
__END_DECLS
#endif /* _KERNEL */
==== //depot/projects/power/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/power/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/power/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/power/sys/boot/i386/boot0/boot0sio.s#2 (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/power/sys/compat/ndis/kern_ndis.c#3 (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.23 2004/01/07 06:15:56 wpaul Exp $");
#include <sys/param.h>
#include <sys/types.h>
@@ -704,6 +704,8 @@
return(0);
}
+typedef void (*ndis_senddone_func)(ndis_handle, ndis_packet *, ndis_status);
+
int
ndis_send_packets(arg, packets, cnt)
void *arg;
@@ -713,14 +715,14 @@
struct ndis_softc *sc;
ndis_handle adapter;
__stdcall ndis_sendmulti_handler sendfunc;
- int i, idx;
- struct ifnet *ifp;
- struct mbuf *m;
+ __stdcall ndis_senddone_func senddonefunc;
+ int i;
ndis_packet *p;
sc = arg;
adapter = sc->ndis_block.nmb_miniportadapterctx;
sendfunc = sc->ndis_chars.nmc_sendmulti_func;
+ senddonefunc = sc->ndis_block.nmb_senddone_func;
sendfunc(adapter, packets, cnt);
for (i = 0; i < cnt; i++) {
@@ -733,21 +735,7 @@
*/
if (p == NULL || p->np_oob.npo_status == NDIS_STATUS_PENDING)
continue;
- idx = p->np_txidx;
- m = p->np_m0;
- ifp = &sc->arpcom.ac_if;
- if (sc->ndis_sc)
- bus_dmamap_unload(sc->ndis_ttag, sc->ndis_tmaps[idx]);
- sc->ndis_txarray[idx] = NULL;
- sc->ndis_txpending++;
- m_freem(m);
- ndis_free_packet(p);
- if (p->np_oob.npo_status == NDIS_STATUS_SUCCESS)
- ifp->if_opackets++;
- else
- ifp->if_oerrors++;
- ifp->if_timer = 0;
- ifp->if_flags &= ~IFF_OACTIVE;
+ senddonefunc(&sc->ndis_block, p, p->np_oob.npo_status);
}
return(0);
@@ -1179,6 +1167,7 @@
block->nmb_ifp = &sc->arpcom.ac_if;
block->nmb_dev = sc->ndis_dev;
+ block->nmb_img = img;
return(0);
}
==== //depot/projects/power/sys/compat/ndis/ndis_var.h#3 (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/power/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/power/sys/compat/ndis/subr_ndis.c#3 (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.30 2004/01/07 19:26:47 wpaul Exp $");
/*
* This file implements a translation layer between the BSD networking
@@ -72,6 +72,7 @@
#include <net/if_dl.h>
#include <net/if_media.h>
+#include <machine/atomic.h>
#include <machine/bus_memio.h>
#include <machine/bus_pio.h>
#include <machine/bus.h>
@@ -789,17 +790,29 @@
* The errorlog routine uses a variable argument list, so we
* have to declare it this way.
*/
+#define ERRMSGLEN 512
static void
ndis_syslog(ndis_handle adapter, ndis_error_code code,
uint32_t numerrors, ...)
{
ndis_miniport_block *block;
va_list ap;
- int i;
+ int i, error;
+ char *str = NULL, *ustr = NULL;
+ uint16_t flags;
+ char msgbuf[ERRMSGLEN];
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) {
+ ustr = msgbuf;
+ ndis_unicode_to_ascii((uint16_t *)str,
+ ((i / 2)) > (ERRMSGLEN - 1) ? ERRMSGLEN : 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);
@@ -1770,9 +1783,7 @@
ndis_interlock_inc(addend)
uint32_t *addend;
{
- mtx_lock(&ndis_interlock);
- *addend++;
- mtx_unlock(&ndis_interlock);
+ atomic_add_long((u_long *)addend, 1);
return(*addend);
}
@@ -1780,9 +1791,7 @@
ndis_interlock_dec(addend)
uint32_t *addend;
{
- mtx_lock(&ndis_interlock);
- *addend--;
- mtx_unlock(&ndis_interlock);
+ atomic_subtract_long((u_long *)addend, 1);
return(*addend);
}
@@ -1894,7 +1903,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);
}
@@ -2070,13 +2086,13 @@
{
ndis_list_entry *flink;
- mtx_lock_spin((struct mtx *)lock->nsl_spinlock);
+ mtx_lock((struct mtx *)lock->nsl_spinlock);
flink = head->nle_flink;
entry->nle_flink = flink;
entry->nle_blink = head;
flink->nle_blink = entry;
head->nle_flink = entry;
- mtx_unlock_spin((struct mtx *)lock->nsl_spinlock);
+ mtx_unlock((struct mtx *)lock->nsl_spinlock);
return(flink);
}
@@ -2089,12 +2105,12 @@
ndis_list_entry *flink;
ndis_list_entry *entry;
- mtx_lock_spin((struct mtx *)lock->nsl_spinlock);
+ mtx_lock((struct mtx *)lock->nsl_spinlock);
entry = head->nle_flink;
flink = entry->nle_flink;
head->nle_flink = flink;
flink->nle_blink = head;
- mtx_unlock_spin((struct mtx *)lock->nsl_spinlock);
+ mtx_unlock((struct mtx *)lock->nsl_spinlock);
return(entry);
}
@@ -2107,13 +2123,13 @@
{
ndis_list_entry *blink;
- mtx_lock_spin((struct mtx *)lock->nsl_spinlock);
+ mtx_lock((struct mtx *)lock->nsl_spinlock);
blink = head->nle_blink;
entry->nle_flink = head;
entry->nle_blink = blink;
blink->nle_flink = entry;
head->nle_blink = entry;
- mtx_unlock_spin((struct mtx *)lock->nsl_spinlock);
+ mtx_unlock((struct mtx *)lock->nsl_spinlock);
return(blink);
}
==== //depot/projects/power/sys/compat/ndis/subr_ntoskrnl.c#3 (text+ko) ====
@@ -31,8 +31,9 @@
*/
#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.10 2004/01/07 20:31:51 wpaul Exp $");
+#include <sys/ctype.h>
#include <sys/param.h>
#include <sys/types.h>
#include <sys/errno.h>
@@ -44,6 +45,7 @@
#include <sys/callout.h>
#include <sys/kernel.h>
+#include <machine/atomic.h>
#include <machine/clock.h>
#include <machine/bus_memio.h>
#include <machine/bus_pio.h>
@@ -59,10 +61,12 @@
#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 *,
- ndis_unicode_string *, uint32_t);
+__stdcall static uint8_t ntoskrnl_unicode_equal(ndis_unicode_string *,
+ ndis_unicode_string *, uint8_t);
__stdcall static void ntoskrnl_unicode_copy(ndis_unicode_string *,
ndis_unicode_string *);
__stdcall static uint32_t ntoskrnl_unicode_to_ansi(ndis_ansi_string *,
@@ -82,13 +86,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 +112,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 +127,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);
@@ -135,29 +141,29 @@
return(0);
}
-__stdcall static uint32_t
-ntoskrnl_unicode_equal(str1, str2, casesensitive)
+__stdcall static uint8_t
+ntoskrnl_unicode_equal(str1, str2, caseinsensitive)
ndis_unicode_string *str1;
ndis_unicode_string *str2;
- uint32_t casesensitive;
+ uint8_t caseinsensitive;
{
- char *astr1 = NULL, *astr2 = NULL;
- int rval = 1;
+ int i;
- ndis_unicode_to_ascii(str1->nus_buf, str2->nus_len, &astr1);
- ndis_unicode_to_ascii(str2->nus_buf, str2->nus_len, &astr2);
+ if (str1->nus_len != str2->nus_len)
+ return(FALSE);
- if (casesensitive)
- rval = strcmp(astr1, astr2);
-#ifdef notdef
- else
- rval = strcasecmp(astr1, astr2);
-#endif
+ for (i = 0; i < str1->nus_len; i++) {
+ if (caseinsensitive == TRUE) {
+ if (toupper((char)(str1->nus_buf[i] & 0xFF)) !=
+ toupper((char)(str2->nus_buf[i] & 0xFF)))
+ return(FALSE);
+ } else {
+ if (str1->nus_buf[i] != str2->nus_buf[i])
+ return(FALSE);
+ }
+ }
- free(astr1, M_DEVBUF);
- free(astr2, M_DEVBUF);
-
- return(rval);
+ return(TRUE);
}
__stdcall static void
@@ -333,34 +339,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,32 +573,26 @@
return;
}
-__stdcall static void
+__stdcall static uint32_t
ntoskrnl_interlock_inc(/*addend*/ void)
{
volatile uint32_t *addend;
__asm__ __volatile__ ("" : "=c" (addend));
- mtx_lock(&ntoskrnl_interlock);
- (*addend)++;
- mtx_unlock(&ntoskrnl_interlock);
-
- return;
+ atomic_add_long((volatile u_long *)addend, 1);
+ return(*addend);
}
-__stdcall static void
+__stdcall static uint32_t
ntoskrnl_interlock_dec(/*addend*/ void)
{
volatile uint32_t *addend;
__asm__ __volatile__ ("" : "=c" (addend));
- mtx_lock(&ntoskrnl_interlock);
- (*addend)--;
- mtx_unlock(&ntoskrnl_interlock);
-
- return;
+ atomic_subtract_long((volatile u_long *)addend, 1);
+ return(*addend);
}
__stdcall static void
@@ -623,20 +623,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;
-
- 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)&ntoskrnl_interlock;
- *lock = (kspin_lock)mtx;
-
return;
}
@@ -715,7 +715,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/power/sys/compat/ndis/subr_pe.c#2 (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/power/sys/conf/options.pc98#4 (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/power/sys/dev/ath/if_ath.c#6 (text+ko) ====
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__FBSDID("$FreeBSD: src/sys/dev/ath/if_ath.c,v 1.38 2003/12/28 07:00:32 sam Exp $");
+__FBSDID("$FreeBSD: src/sys/dev/ath/if_ath.c,v 1.44 2004/01/07 19:16:49 sam Exp $");
/*
* Driver for the Atheros Wireless LAN controller.
@@ -149,9 +149,11 @@
static int ath_outdoor = AH_TRUE; /* outdoor operation */
SYSCTL_INT(_hw_ath, OID_AUTO, outdoor, CTLFLAG_RD, &ath_outdoor,
0, "enable/disable outdoor operation");
+TUNABLE_INT("hw.ath.outdoor", &ath_outdoor);
static int ath_countrycode = CTRY_DEFAULT; /* country code */
SYSCTL_INT(_hw_ath, OID_AUTO, countrycode, CTLFLAG_RD, &ath_countrycode,
0, "country code");
+TUNABLE_INT("hw.ath.countrycode", &ath_countrycode);
static int ath_regdomain = 0; /* regulatory domain */
SYSCTL_INT(_hw_ath, OID_AUTO, regdomain, CTLFLAG_RD, &ath_regdomain,
0, "regulatory domain");
@@ -160,18 +162,34 @@
int ath_debug = 0;
SYSCTL_INT(_hw_ath, OID_AUTO, debug, CTLFLAG_RW, &ath_debug,
>>> TRUNCATED FOR MAIL (1000 lines) <<<
More information about the p4-projects
mailing list