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