Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 209961
b: refs/heads/master
c: 25edd69
h: refs/heads/master
i:
  209959: 8696ac7
v: v3
  • Loading branch information
David S. Miller committed Aug 24, 2010
1 parent ebd942e commit 4b424e6
Show file tree
Hide file tree
Showing 8 changed files with 457 additions and 298 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 019408f9b89c68cd7b8ddb904960dc17ccf7e531
refs/heads/master: 25edd6946a1d74e5e77813c2324a0908c68bcf9e
27 changes: 3 additions & 24 deletions trunk/arch/sparc/include/asm/oplib_64.h
Original file line number Diff line number Diff line change
Expand Up @@ -185,9 +185,8 @@ extern int prom_getunumber(int syndrome_code,
char *buf, int buflen);

/* Retain physical memory to the caller across soft resets. */
extern unsigned long prom_retain(const char *name,
unsigned long pa_low, unsigned long pa_high,
long size, long align);
extern int prom_retain(const char *name, unsigned long size,
unsigned long align, unsigned long *paddr);

/* Load explicit I/D TLB entries into the calling processor. */
extern long prom_itlb_load(unsigned long index,
Expand Down Expand Up @@ -287,26 +286,6 @@ extern void prom_sun4v_guest_soft_state(void);
extern int prom_ihandle2path(int handle, char *buffer, int bufsize);

/* Client interface level routines. */
extern long p1275_cmd(const char *, long, ...);

#if 0
#define P1275_SIZE(x) ((((long)((x) / 32)) << 32) | (x))
#else
#define P1275_SIZE(x) x
#endif

/* We support at most 16 input and 1 output argument */
#define P1275_ARG_NUMBER 0
#define P1275_ARG_IN_STRING 1
#define P1275_ARG_OUT_BUF 2
#define P1275_ARG_OUT_32B 3
#define P1275_ARG_IN_FUNCTION 4
#define P1275_ARG_IN_BUF 5
#define P1275_ARG_IN_64B 6

#define P1275_IN(x) ((x) & 0xf)
#define P1275_OUT(x) (((x) << 4) & 0xf0)
#define P1275_INOUT(i,o) (P1275_IN(i)|P1275_OUT(o))
#define P1275_ARG(n,x) ((x) << ((n)*3 + 8))
extern void p1275_cmd_direct(unsigned long *);

#endif /* !(__SPARC64_OPLIB_H) */
16 changes: 8 additions & 8 deletions trunk/arch/sparc/prom/cif.S
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,18 @@
#include <asm/thread_info.h>

.text
.globl prom_cif_interface
prom_cif_interface:
sethi %hi(p1275buf), %o0
or %o0, %lo(p1275buf), %o0
ldx [%o0 + 0x010], %o1 ! prom_cif_stack
save %o1, -192, %sp
ldx [%i0 + 0x008], %l2 ! prom_cif_handler
.globl prom_cif_direct
prom_cif_direct:
sethi %hi(p1275buf), %o1
or %o1, %lo(p1275buf), %o1
ldx [%o1 + 0x0010], %o2 ! prom_cif_stack
save %o2, -192, %sp
ldx [%i1 + 0x0008], %l2 ! prom_cif_handler
mov %g4, %l0
mov %g5, %l1
mov %g6, %l3
call %l2
add %i0, 0x018, %o0 ! prom_args
mov %i0, %o0 ! prom_args
mov %l0, %g4
mov %l1, %g5
mov %l3, %g6
Expand Down
48 changes: 37 additions & 11 deletions trunk/arch/sparc/prom/console_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,22 @@ extern int prom_stdin, prom_stdout;
inline int
prom_nbgetchar(void)
{
unsigned long args[7];
char inc;

if (p1275_cmd("read", P1275_ARG(1,P1275_ARG_OUT_BUF)|
P1275_INOUT(3,1),
prom_stdin, &inc, P1275_SIZE(1)) == 1)
args[0] = (unsigned long) "read";
args[1] = 3;
args[2] = 1;
args[3] = (unsigned int) prom_stdin;
args[4] = (unsigned long) &inc;
args[5] = 1;
args[6] = (unsigned long) -1;

p1275_cmd_direct(args);

if (args[6] == 1)
return inc;
else
return -1;
return -1;
}

/* Non blocking put character to console device, returns -1 if
Expand All @@ -37,12 +45,22 @@ prom_nbgetchar(void)
inline int
prom_nbputchar(char c)
{
unsigned long args[7];
char outc;

outc = c;
if (p1275_cmd("write", P1275_ARG(1,P1275_ARG_IN_BUF)|
P1275_INOUT(3,1),
prom_stdout, &outc, P1275_SIZE(1)) == 1)

args[0] = (unsigned long) "write";
args[1] = 3;
args[2] = 1;
args[3] = (unsigned int) prom_stdout;
args[4] = (unsigned long) &outc;
args[5] = 1;
args[6] = (unsigned long) -1;

p1275_cmd_direct(args);

if (args[6] == 1)
return 0;
else
return -1;
Expand All @@ -67,7 +85,15 @@ prom_putchar(char c)
void
prom_puts(const char *s, int len)
{
p1275_cmd("write", P1275_ARG(1,P1275_ARG_IN_BUF)|
P1275_INOUT(3,1),
prom_stdout, s, P1275_SIZE(len));
unsigned long args[7];

args[0] = (unsigned long) "write";
args[1] = 3;
args[2] = 1;
args[3] = (unsigned int) prom_stdout;
args[4] = (unsigned long) s;
args[5] = len;
args[6] = (unsigned long) -1;

p1275_cmd_direct(args);
}
36 changes: 31 additions & 5 deletions trunk/arch/sparc/prom/devops_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,32 @@
int
prom_devopen(const char *dstr)
{
return p1275_cmd ("open", P1275_ARG(0,P1275_ARG_IN_STRING)|
P1275_INOUT(1,1),
dstr);
unsigned long args[5];

args[0] = (unsigned long) "open";
args[1] = 1;
args[2] = 1;
args[3] = (unsigned long) dstr;
args[4] = (unsigned long) -1;

p1275_cmd_direct(args);

return (int) args[4];
}

/* Close the device described by device handle 'dhandle'. */
int
prom_devclose(int dhandle)
{
p1275_cmd ("close", P1275_INOUT(1,0), dhandle);
unsigned long args[4];

args[0] = (unsigned long) "close";
args[1] = 1;
args[2] = 0;
args[3] = (unsigned int) dhandle;

p1275_cmd_direct(args);

return 0;
}

Expand All @@ -37,5 +53,15 @@ prom_devclose(int dhandle)
void
prom_seek(int dhandle, unsigned int seekhi, unsigned int seeklo)
{
p1275_cmd ("seek", P1275_INOUT(3,1), dhandle, seekhi, seeklo);
unsigned long args[7];

args[0] = (unsigned long) "seek";
args[1] = 3;
args[2] = 1;
args[3] = (unsigned int) dhandle;
args[4] = seekhi;
args[5] = seeklo;
args[6] = (unsigned long) -1;

p1275_cmd_direct(args);
}
Loading

0 comments on commit 4b424e6

Please sign in to comment.