This source file includes following definitions.
- prom_devopen
- prom_close
- prom_seek
1
2
3
4
5
6
7 #include <asm/openprom.h>
8 #include <asm/oplib.h>
9
10
11
12
13
14 int
15 prom_devopen(char *dstr)
16 {
17 int handle;
18 switch(prom_vers) {
19 case PROM_V0:
20 handle = (*(romvec->pv_v0devops.v0_devopen))(dstr);
21 if(handle == 0) return -1;
22 return handle;
23 break;
24 case PROM_V2:
25 case PROM_V3:
26 case PROM_P1275:
27 handle = (*(romvec->pv_v2devops.v2_dev_open))(dstr);
28 return handle;
29 break;
30 case PROM_AP1000:
31 break;
32 };
33
34 return -1;
35 }
36
37
38 void
39 prom_close(int dhandle)
40 {
41 switch(prom_vers) {
42 case PROM_V0:
43 (*(romvec->pv_v0devops.v0_devclose))(dhandle);
44 return;
45 case PROM_V2:
46 case PROM_V3:
47 case PROM_P1275:
48 (*(romvec->pv_v2devops.v2_dev_close))(dhandle);
49 return;
50 case PROM_AP1000:
51 return;
52 };
53 return;
54 }
55
56
57
58
59 void
60 prom_seek(int dhandle, unsigned int seekhi, unsigned int seeklo)
61 {
62 switch(prom_vers) {
63 case PROM_V0:
64 (*(romvec->pv_v0devops.v0_seekdev))(dhandle, seekhi, seeklo);
65 break;
66 case PROM_V2:
67 case PROM_V3:
68 case PROM_P1275:
69 (*(romvec->pv_v2devops.v2_dev_seek))(dhandle, seekhi, seeklo);
70 break;
71 case PROM_AP1000:
72 break;
73 };
74
75 return;
76 }