3 msgBroken RFC1323 slightly broken.
6 msgUndefined symbol timer_delete()?
3 msgbtsocks_rfcomm_session_mtx / so_snd_sx LOR
1 msgnvidia 7900gs pci-e, do i need device AGP in ke...
1 msglinux-sun-jdk-1.5.0.12,2 - java SIGSEGV and the...
31 msgkernel panic with pccard insert on recent 7.0 C...

smi speedstep patch
\ Nate Lawson (16 Jun 2007)
. \ Nate Lawson (16 Jun 2007)
. . \ Nate Lawson (16 Jun 2007)
. . . \ John Baldwin (16 Jul 2007)
. . . . \ Nate Lawson (16 Jul 2007)
. . . . . \ John Baldwin (16 Jul 2007)

6 msgpf 4.1 Update available for testing
1 msgbacula-client build failure on recent -CURRENT
4 msgAccess to tape drive caused following backtrace
2 msg[REVIEW]: add multicast NULL route
4 msgGerman keymap not working
6 msgmulticast not happy ?
19 msgrecent nvidia-driver trouble
10 msgSwapfile on ZFS & Deadlock
10 msgmoused linear acceleration drops
1 msgcached to nscd (was Re: nscd for freebsd)
3 msgIntel 965 and AGP
5 msgannoying behavior in less(1) after v403 import
3 msgSleeping and my T43
Subject:smi speedstep patch
Group:Freebsd-current
From:Nate Lawson
Date:16 Jun 2007


 

If you have a pentium 3 that works for speedstep, please try this patch.
It fixes the PAE case. Compile-tested.

--
Nate


Index: sys/i386/cpufreq/smist.c
===================================================================
RCS file: /home/ncvs/src/sys/i386/cpufreq/smist.c,v
retrieving revision 1.1
diff -d -u -r1.1 smist.c
--- sys/i386/cpufreq/smist.c 19 Apr 2005 16:38:24 -0000 1.1
+++ sys/i386/cpufreq/smist.c 16 Jun 2007 02:42:03 -0000
@@ -45,6 +45,7 @@
#include <sys/module.h>
#include <sys/systm.h>

+#include <machine/bus.h>
#include <machine/md_var.h>
#include <machine/vm86.h>

@@ -71,6 +72,8 @@
struct cf_setting sets[2]; /* Only two settings. */
};

+static char smist_magic[] = "Copyright (c) 1999 Intel Corporation";
+
static void smist_identify(driver_t *driver, device_t parent);
static int smist_probe(device_t dev);
static int smist_attach(device_t dev);
@@ -150,16 +153,39 @@
static int
set_ownership(device_t dev)
{
- int result;
struct smist_softc *sc;
- vm_paddr_t pmagic;
- static char magic[] = "Copyright (c) 1999 Intel Corporation";
+ bus_dma_tag_t tag;
+ bus_dmamap_t map;
+ void *magic_buf;
+ int result;

+ /*
+ * Specify the region to store the magic string. Since its address is
+ * passed to the BIOS in a 32-bit register, we have to make sure it is
+ * located in a buffer below 4 GB (i.e., for PAE.)
+ */
sc = device_get_softc(dev);
- if (!sc)
+ if (bus_dma_tag_create(/*parent*/ NULL,
+ /*alignment*/ PAGE_SIZE, /*no boundary*/ 0,
+ /*lowaddr*/ 0, /*highaddr*/ (1<<31), NULL, NULL,
+ /*maxsize*/ PAGE_SIZE, /*segments*/ 1, /*maxsegsize*/ PAGE_SIZE,
+ 0, busdma_lock_mutex, &Giant, &tag) != 0) {
+ device_printf(dev, "can't create mem tag\n");
return (ENXIO);
-
- pmagic = vtophys(magic);
+ }
+ if (bus_dmamem_alloc(tag, &magic_buf, BUS_DMA_NOWAIT, &map) != 0) {
+ bus_dma_tag_destroy(tag);
+ device_printf(dev, "can't alloc mapped mem\n");
+ return (ENXIO);
+ }
+ if (bus_dmamap_load(tag, map, magic_buf, PAGE_SIZE, NULL, NULL,
+ BUS_DMA_NOWAIT) != 0) {
+ bus_dmamem_free(tag, magic_buf, map);
+ bus_dma_tag_destroy(tag);
+ device_printf(dev, "can't load mem\n");
+ return (ENXIO);
+ };
+ strlcpy(magic_buf, smist_magic, PAGE_SIZE);

__asm __volatile(
"movl $-1, %%edi\n\t"
@@ -169,11 +195,14 @@
"b" (0),
"c" (0),
"d" (sc->smi_cmd),
- "S" (pmagic)
+ "S" ((u_int)(uintptr_t)magic_buf)
);

DPRINT(dev, "taking ownership over BIOS return %d\n", result);

+ bus_dmamap_unload(tag, map);
+ bus_dmamem_free(tag, magic_buf, map);
+ bus_dma_tag_destroy(tag);
return (result ? ENXIO : 0);
}



_______________________________________________
freebsd-current mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-current
To unsubscribe, send any mail to "freebsd-current-unsubscribe"


© 2004-2008 readlist.com