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 };
31
32 return -1;
33 }
34
35
36 void
37 prom_close(int dhandle)
38 {
39 switch(prom_vers) {
40 case PROM_V0:
41 (*(romvec->pv_v0devops.v0_devclose))(dhandle);
42 return;
43 case PROM_V2:
44 case PROM_V3:
45 case PROM_P1275:
46 (*(romvec->pv_v2devops.v2_dev_close))(dhandle);
47 return;
48 };
49 return;
50 }
51
52
53
54
55 void
56 prom_seek(int dhandle, unsigned int seekhi, unsigned int seeklo)
57 {
58 switch(prom_vers) {
59 case PROM_V0:
60 (*(romvec->pv_v0devops.v0_seekdev))(dhandle, seekhi, seeklo);
61 break;
62 case PROM_V2:
63 case PROM_V3:
64 case PROM_P1275:
65 (*(romvec->pv_v2devops.v2_dev_seek))(dhandle, seekhi, seeklo);
66 break;
67 };
68
69 return;
70 }