aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc/prom/devops_64.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/sparc/prom/devops_64.c')
-rw-r--r--arch/sparc/prom/devops_64.c36
1 files changed, 31 insertions, 5 deletions
diff --git a/arch/sparc/prom/devops_64.c b/arch/sparc/prom/devops_64.c
index 9dbd803e46e1..a017119e7ef1 100644
--- a/arch/sparc/prom/devops_64.c
+++ b/arch/sparc/prom/devops_64.c
@@ -18,16 +18,32 @@
18int 18int
19prom_devopen(const char *dstr) 19prom_devopen(const char *dstr)
20{ 20{
21 return p1275_cmd ("open", P1275_ARG(0,P1275_ARG_IN_STRING)| 21 unsigned long args[5];
22 P1275_INOUT(1,1), 22
23 dstr); 23 args[0] = (unsigned long) "open";
24 args[1] = 1;
25 args[2] = 1;
26 args[3] = (unsigned long) dstr;
27 args[4] = (unsigned long) -1;
28
29 p1275_cmd_direct(args);
30
31 return (int) args[4];
24} 32}
25 33
26/* Close the device described by device handle 'dhandle'. */ 34/* Close the device described by device handle 'dhandle'. */
27int 35int
28prom_devclose(int dhandle) 36prom_devclose(int dhandle)
29{ 37{
30 p1275_cmd ("close", P1275_INOUT(1,0), dhandle); 38 unsigned long args[4];
39
40 args[0] = (unsigned long) "close";
41 args[1] = 1;
42 args[2] = 0;
43 args[3] = (unsigned int) dhandle;
44
45 p1275_cmd_direct(args);
46
31 return 0; 47 return 0;
32} 48}
33 49
@@ -37,5 +53,15 @@ prom_devclose(int dhandle)
37void 53void
38prom_seek(int dhandle, unsigned int seekhi, unsigned int seeklo) 54prom_seek(int dhandle, unsigned int seekhi, unsigned int seeklo)
39{ 55{
40 p1275_cmd ("seek", P1275_INOUT(3,1), dhandle, seekhi, seeklo); 56 unsigned long args[7];
57
58 args[0] = (unsigned long) "seek";
59 args[1] = 3;
60 args[2] = 1;
61 args[3] = (unsigned int) dhandle;
62 args[4] = seekhi;
63 args[5] = seeklo;
64 args[6] = (unsigned long) -1;
65
66 p1275_cmd_direct(args);
41} 67}