aboutsummaryrefslogtreecommitdiff
path: root/lib/libhvcall/hvcall.S
diff options
context:
space:
mode:
authorBenjamin Herrenschmidt <benh@kernel.crashing.org>2010-12-03 15:02:36 +1100
committerThomas Huth <thuth@linux.vnet.ibm.com>2011-03-22 15:22:00 +0100
commit39426bad550f340dcf2b544ae23f465fbbbc42f5 (patch)
tree1974f16adec8b1322b4adeaa65783780a5ebeb25 /lib/libhvcall/hvcall.S
parentcf69a59a3edefc3bea57cceea2cbedd25c7b680d (diff)
downloadSLOF-39426bad550f340dcf2b544ae23f465fbbbc42f5.zip
SLOF-39426bad550f340dcf2b544ae23f465fbbbc42f5.tar.gz
SLOF-39426bad550f340dcf2b544ae23f465fbbbc42f5.tar.bz2
Initial qemu/KVM board support
Added a new board for SLOF running on KVM/qemu. Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org> Signed-off-by: Thomas Huth <thuth@linux.vnet.ibm.com>
Diffstat (limited to 'lib/libhvcall/hvcall.S')
-rw-r--r--lib/libhvcall/hvcall.S86
1 files changed, 86 insertions, 0 deletions
diff --git a/lib/libhvcall/hvcall.S b/lib/libhvcall/hvcall.S
new file mode 100644
index 0000000..5cc0bd7
--- /dev/null
+++ b/lib/libhvcall/hvcall.S
@@ -0,0 +1,86 @@
+#define _ASM
+#define __ASSEMBLY__
+#include "macros.h"
+#include "libhvcall.h"
+
+#define HVCALL .long 0x44000022
+
+ .text
+ .align 3
+
+ENTRY(hv_generic)
+ HVCALL
+ blr
+
+ENTRY(hv_putchar)
+ sldi r6,r3,(24+32)
+ li r3,H_PUT_TERM_CHAR
+ li r4,0
+ li r5,1
+ HVCALL
+ blr
+
+ENTRY(hv_getchar)
+ mflr r10
+ bl .hv_haschar
+ mtlr r10
+ cmpwi cr0,r3,0
+ beqlr
+ lis r9,inbuf@h
+ ori r9,r9,inbuf@l
+ lwz r4,20(r9)
+ lbzx r3,r4,r9
+ addi r4,r4,1
+ stw r4,20(r9)
+ blr
+
+ENTRY(hv_haschar)
+ li r3,-1
+ lis r9,inbuf@h
+ ori r9,r9,inbuf@l
+ lwz r5,16(r9)
+ lwz r6,20(r9)
+ cmplw cr0,r5,r6
+ bnelr
+ li r3,H_GET_TERM_CHAR
+ li r4,0
+ HVCALL
+ lis r9,inbuf@h
+ ori r9,r9,inbuf@l
+ stw r4,16(r9)
+ li r3,0
+ stw r3,20(r9)
+ cmplwi cr0,r4,0
+ beqlr
+ li r3,-1
+ std r5,0(r9)
+ std r6,8(r9)
+ blr
+
+ENTRY(hv_send_crq)
+ ld r5,0(r4)
+ ld r6,8(r4)
+ mr r4,r3
+ li r3,H_SEND_CRQ
+ HVCALL
+ blr
+
+ENTRY(hv_send_logical_lan)
+ li r11,0 /* no continue token for now */
+ mr r10,r9
+ mr r9,r8
+ mr r8,r7
+ mr r7,r6
+ mr r6,r5
+ mr r5,r4
+ mr r4,r3
+ li r3,H_SEND_LOGICAL_LAN
+ HVCALL
+ blr
+
+ .section ".bss"
+ inbuf: .space 16
+inlen: .space 4
+inpos: .space 4
+ .text
+ \ No newline at end of file