aboutsummaryrefslogtreecommitdiff
path: root/slof/ppc64.c
diff options
context:
space:
mode:
Diffstat (limited to 'slof/ppc64.c')
-rw-r--r--slof/ppc64.c74
1 files changed, 39 insertions, 35 deletions
diff --git a/slof/ppc64.c b/slof/ppc64.c
index ff94d3d..8ad828c 100644
--- a/slof/ppc64.c
+++ b/slof/ppc64.c
@@ -16,30 +16,30 @@
* the_exception_frame is used by the handler to store a copy of all
* registers after an exception; this copy can then be used by paflof's
* exception handler to printout a register dump */
-cell the_exception_frame[0x400/CELLSIZE] __attribute__ ((aligned(PAGE_SIZE)));;
+cell the_exception_frame[0x400 / CELLSIZE] __attribute__ ((aligned(PAGE_SIZE)));;
/* the_client_frame is the register save area when starting a client */
-cell the_client_frame[0x1000/CELLSIZE] __attribute__ ((aligned(0x100)));
-cell the_client_stack[0x2000/CELLSIZE] __attribute__ ((aligned(0x100)));
+cell the_client_frame[0x1000 / CELLSIZE] __attribute__ ((aligned(0x100)));
+cell the_client_stack[0x8000 / CELLSIZE] __attribute__ ((aligned(0x100)));
/* THE forth stack */
-cell the_data_stack[0x2000/CELLSIZE] __attribute__ ((aligned(0x100)));
+cell the_data_stack[0x2000 / CELLSIZE] __attribute__ ((aligned(0x100)));
/* the forth return stack */
-cell the_return_stack[0x2000/CELLSIZE] __attribute__ ((aligned(0x100)));
+cell the_return_stack[0x2000 / CELLSIZE] __attribute__ ((aligned(0x100)));
/* forth stack and return-stack pointers */
cell *restrict dp;
cell *restrict rp;
/* terminal input buffer */
-cell the_tib[0x1000/CELLSIZE] __attribute__ ((aligned(0x100)));
+cell the_tib[0x1000 / CELLSIZE] __attribute__ ((aligned(0x100)));
/* temporary string buffers */
-char the_pockets[NUMPOCKETS*POCKETSIZE] __attribute__ ((aligned(0x100)));
+char the_pockets[NUMPOCKETS * POCKETSIZE] __attribute__ ((aligned(0x100)));
-cell the_comp_buffer[0x1000/CELLSIZE] __attribute__ ((aligned(0x100)));
+cell the_comp_buffer[0x1000 / CELLSIZE] __attribute__ ((aligned(0x100)));
-cell the_heap[HEAP_SIZE/CELLSIZE] __attribute__ ((aligned(0x1000)));
+cell the_heap[HEAP_SIZE / CELLSIZE] __attribute__ ((aligned(0x1000)));
cell *the_heap_start = &the_heap[0];
-cell *the_heap_end = &the_heap[HEAP_SIZE/CELLSIZE];
+cell *the_heap_end = &the_heap[HEAP_SIZE / CELLSIZE];
extern void io_putchar(unsigned char);
@@ -47,23 +47,25 @@ extern void io_putchar(unsigned char);
static unsigned long __attribute__((noinline))
call_c(cell arg0, cell arg1, cell arg2, cell entry)
{
- register unsigned long r3 asm("r3") = arg0.u;
- register unsigned long r4 asm("r4") = arg1.u;
- register unsigned long r5 asm("r5") = arg2.u;
- register unsigned long r6 = entry.u ;
-
- asm volatile("mflr 31 ; mtctr %4 ; bctrl ; mtlr 31"
- : "=r"(r3)
- : "r"(r3), "r"(r4), "r"(r5), "r"(r6)
- : "ctr", "r31");
-
- return r3;
+ register unsigned long r3 asm("r3") = arg0.u;
+ register unsigned long r4 asm("r4") = arg1.u;
+ register unsigned long r5 asm("r5") = arg2.u;
+ register unsigned long r6 = entry.u ;
+
+ asm volatile("mflr 31 ; mtctr %4 ; bctrl ; mtlr 31"
+ : "=r" (r3)
+ : "r" (r3), "r" (r4), "r" (r5), "r" (r6)
+ : "ctr", "r6", "r7", "r8", "r9", "r10", "r11",
+ "r12", "r13", "r31");
+
+ return r3;
}
long
writeLogByte_wrapper(long x, long y)
{
unsigned long result;
+
set_ci();
result = writeLogByte(x, y);
clr_ci();
@@ -79,26 +81,28 @@ writeLogByte_wrapper(long x, long y)
* @param count number of bytes to be written
* @return the number of bytes that have been written successfully
*/
-int write(int fd, const void *buf, int count)
+int
+write(int fd, const void *buf, int count)
{
- int i;
- char *ptr = (char *)buf;
+ int i;
+ char *ptr = (char *)buf;
- if (fd != 1 && fd != 2)
- return 0;
+ if (fd != 1 && fd != 2)
+ return 0;
- for (i = 0; i < count; i++) {
- if (*ptr == '\n')
- io_putchar('\r');
- io_putchar(*ptr++);
- }
+ for (i = 0; i < count; i++) {
+ if (*ptr == '\n')
+ io_putchar('\r');
+ io_putchar(*ptr++);
+ }
- return i;
+ return i;
}
-/* This should probably be temporary until a better solution is fount */
-void asm_cout(long Character,long UART,long NVRAM __attribute__((unused)))
+/* This should probably be temporary until a better solution is found */
+void
+asm_cout(long Character, long UART, long NVRAM __attribute__((unused)))
{
- if(UART)
+ if (UART)
io_putchar(Character);
}