|
Lines 1-6
Link Here
|
| 1 |
--- rovclock.c.orig 2006-01-04 21:23:32 UTC |
1 |
--- rovclock.c.orig 2006-01-04 21:23:32 UTC |
| 2 |
+++ rovclock.c |
2 |
+++ rovclock.c |
| 3 |
@@ -20,11 +20,13 @@ |
3 |
@@ -20,11 +20,16 @@ |
| 4 |
*/ |
4 |
*/ |
| 5 |
/*****************************************************************************/ |
5 |
/*****************************************************************************/ |
| 6 |
|
6 |
|
|
Lines 11-21
Link Here
|
| 11 |
#include <getopt.h> |
11 |
#include <getopt.h> |
| 12 |
-#include <sys/io.h> |
12 |
-#include <sys/io.h> |
| 13 |
+#include <sys/types.h> |
13 |
+#include <sys/types.h> |
|
|
14 |
+#if !defined(__amd64__) && !defined(__i386__) |
| 15 |
+#include <machine/pio.h> |
| 16 |
+#endif |
| 14 |
+#include <machine/cpufunc.h> |
17 |
+#include <machine/cpufunc.h> |
| 15 |
#include <sys/mman.h> |
18 |
#include <sys/mman.h> |
| 16 |
|
19 |
|
| 17 |
#include "pci.h" |
20 |
#include "pci.h" |
| 18 |
@@ -122,18 +124,18 @@ struct rovclock_data { |
21 |
@@ -122,18 +127,18 @@ struct rovclock_data { |
| 19 |
/* PCI read/write functions */ |
22 |
/* PCI read/write functions */ |
| 20 |
unsigned int pci_read(u8 bus, u8 device, u8 func, u8 addr) |
23 |
unsigned int pci_read(u8 bus, u8 device, u8 func, u8 addr) |
| 21 |
{ |
24 |
{ |
|
Lines 39-45
Link Here
|
| 39 |
} |
42 |
} |
| 40 |
|
43 |
|
| 41 |
/* Register read/write functions */ |
44 |
/* Register read/write functions */ |
| 42 |
@@ -144,38 +146,38 @@ u32 reg_read(struct rovclock_data *rovcl |
45 |
@@ -144,38 +149,38 @@ u32 reg_read(struct rovclock_data *rovclock, u32 addr) |
| 43 |
|
46 |
|
| 44 |
void reg_write(struct rovclock_data *rovclock, u32 addr, u32 data) |
47 |
void reg_write(struct rovclock_data *rovclock, u32 addr, u32 data) |
| 45 |
{ |
48 |
{ |
|
Lines 86-92
Link Here
|
| 86 |
} |
89 |
} |
| 87 |
|
90 |
|
| 88 |
/* Print usage */ |
91 |
/* Print usage */ |
| 89 |
@@ -281,10 +283,11 @@ void pll_set_freq(struct rovclock_data * |
92 |
@@ -281,10 +286,11 @@ void pll_set_freq(struct rovclock_data *rovclock) |
| 90 |
/* Search for ATI card on PCI bus */ |
93 |
/* Search for ATI card on PCI bus */ |
| 91 |
int find_card(struct rovclock_data *rovclock) |
94 |
int find_card(struct rovclock_data *rovclock) |
| 92 |
{ |
95 |
{ |
|
Lines 100-106
Link Here
|
| 100 |
/* Check /proc/bus/pci/devices first */ |
103 |
/* Check /proc/bus/pci/devices first */ |
| 101 |
if ((proc = fopen("/proc/bus/pci/devices", "r")) != NULL) { |
104 |
if ((proc = fopen("/proc/bus/pci/devices", "r")) != NULL) { |
| 102 |
while (fscanf(proc, "%x\t%x", &rovclock->pci_bus, &id) == 2) { |
105 |
while (fscanf(proc, "%x\t%x", &rovclock->pci_bus, &id) == 2) { |
| 103 |
@@ -305,8 +308,9 @@ int find_card(struct rovclock_data *rovc |
106 |
@@ -305,8 +311,9 @@ int find_card(struct rovclock_data *rovclock) |
| 104 |
break; |
107 |
break; |
| 105 |
} |
108 |
} |
| 106 |
} |
109 |
} |
|
Lines 111-117
Link Here
|
| 111 |
|
114 |
|
| 112 |
/* Find card by scanning the PCI devices, check from bus 1 to 9 for ATI device */ |
115 |
/* Find card by scanning the PCI devices, check from bus 1 to 9 for ATI device */ |
| 113 |
rovclock->pci_dev = 0; |
116 |
rovclock->pci_dev = 0; |
| 114 |
@@ -423,7 +427,7 @@ int main(int argc, char **argv) |
117 |
@@ -423,7 +430,7 @@ int main(int argc, char **argv) |
| 115 |
} |
118 |
} |
| 116 |
|
119 |
|
| 117 |
/* Get I/O permission */ |
120 |
/* Get I/O permission */ |