summaryrefslogtreecommitdiff
path: root/sys/arch
diff options
context:
space:
mode:
authorTed Unangst <tedu@cvs.openbsd.org>2004-08-05 04:56:06 +0000
committerTed Unangst <tedu@cvs.openbsd.org>2004-08-05 04:56:06 +0000
commitb70a1781bf06b254f036778a4d56ef32b9c90cd0 (patch)
tree95eb591ca9505462c2273254c6e3b5cc5801e0cf /sys/arch
parent4b0ff68364924a0d97ce85e4d199a86536d3da3c (diff)
unmap bios when done. from form@pdp-11.org.ru via grange
Diffstat (limited to 'sys/arch')
-rw-r--r--sys/arch/i386/i386/powernow-k7.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/sys/arch/i386/i386/powernow-k7.c b/sys/arch/i386/i386/powernow-k7.c
index 0f991adb309..ad4c5f79f97 100644
--- a/sys/arch/i386/i386/powernow-k7.c
+++ b/sys/arch/i386/i386/powernow-k7.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: powernow-k7.c,v 1.2 2004/07/14 05:38:37 tedu Exp $ */
+/* $OpenBSD: powernow-k7.c,v 1.3 2004/08/05 04:56:05 tedu Exp $ */
/*
* Copyright (c) 2004 Martin Végiard.
* All rights reserved.
@@ -107,16 +107,19 @@ k7_powernow_getstates(uint32_t signature)
struct psb_s *psb;
struct pst_s *pst;
char *ptr;
+ bus_space_handle_t bh;
/*
* Look in the 0xe0000 - 0x20000 physical address
* range for the pst tables; 16 byte blocks
*/
- if (bus_space_map(I386_BUS_SPACE_MEM, BIOS_START, BIOS_LEN, 0,
- (bus_space_handle_t *)&ptr)) {
+ if (bus_space_map(I386_BUS_SPACE_MEM, BIOS_START, BIOS_LEN, 0, &bh)) {
printf("k7_powernow: couldn't map BIOS\n");
return NULL;
}
+ ptr = malloc(BIOS_LEN, M_DEVBUF, M_NOWAIT);
+ memcpy(ptr, (void *)bh, BIOS_LEN);
+ bus_space_unmap(I386_BUS_SPACE_MEM, bh, BIOS_LEN);
for (i = 0; i < BIOS_LEN; i += 16, ptr += 16) {
if (memcmp(ptr, "AMDK7PNOW!", 10) == 0) {