-
Notifications
You must be signed in to change notification settings - Fork 17
XTF on arm #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
XTF on arm #4
Changes from 1 commit
7c6454f
ff0017f
7b67c42
e110999
4bce24e
31e12f6
13eddf5
11bd786
0cb05ca
309fd29
fcdf8db
ea0093e
c14f7dd
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| #include <xtf/asm_macros.h> | ||
| #include <xen/xen.h> | ||
|
|
||
| #define __HVC(imm16) .long \ | ||
| ((0xE1400070 | (((imm16) & 0xFFF0) << 4) | ((imm16) & 0x000F)) & 0xFFFFFFFF) | ||
|
|
||
| #define HYPERCALL_SIMPLE(hypercall) \ | ||
| ENTRY(hypercall_##hypercall) \ | ||
| mov r12, #__HYPERVISOR_##hypercall; \ | ||
| __HVC(XEN_HYPERCALL_TAG); \ | ||
| mov pc ,lr; \ | ||
| ENDFUNC(hypercall_##hypercall) | ||
|
|
||
| #define HYPERCALL0 HYPERCALL_SIMPLE | ||
| #define HYPERCALL1 HYPERCALL_SIMPLE | ||
| #define HYPERCALL2 HYPERCALL_SIMPLE | ||
| #define HYPERCALL3 HYPERCALL_SIMPLE | ||
| #define HYPERCALL4 HYPERCALL_SIMPLE | ||
|
|
||
| #define HYPERCALL5(hypercall) \ | ||
| ENTRY(hypercall_##hypercall) \ | ||
| stmdb sp!, {r4}; \ | ||
| ldr r4, [sp, #4]; \ | ||
| mov r12, #__HYPERVISOR_##hypercall; \ | ||
| __HVC(XEN_HYPERCALL_TAG); \ | ||
| ldm sp!, {r4}; \ | ||
| mov pc ,lr; \ | ||
| ENDFUNC(hypercall_##hypercall) | ||
|
|
||
| .text | ||
|
|
||
| HYPERCALL2(xen_version); | ||
| HYPERCALL3(console_io); | ||
| HYPERCALL3(grant_table_op); | ||
| HYPERCALL2(sched_op); | ||
| HYPERCALL2(event_channel_op); | ||
| HYPERCALL2(hvm_op); | ||
| HYPERCALL2(memory_op); | ||
| HYPERCALL2(physdev_op); | ||
| HYPERCALL3(vcpu_op); | ||
| HYPERCALL1(tmem_op); | ||
| HYPERCALL2(multicall); | ||
| HYPERCALL2(vm_assist); | ||
| HYPERCALL1(sysctl); | ||
| HYPERCALL1(domctl); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this hypercall list in any specific order?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The wrappers were borrowed from Linux(with little modifications) and the list is not sorted. |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,33 @@ | ||
| #include <xtf/asm_macros.h> | ||
| #include <xen/xen.h> | ||
|
|
||
| #define HYPERCALL_SIMPLE(hypercall) \ | ||
| ENTRY(hypercall_##hypercall) \ | ||
| mov x16, #__HYPERVISOR_##hypercall; \ | ||
| hvc XEN_HYPERCALL_TAG; \ | ||
| ret; \ | ||
| ENDFUNC(hypercall_##hypercall) | ||
|
|
||
| #define HYPERCALL0 HYPERCALL_SIMPLE | ||
| #define HYPERCALL1 HYPERCALL_SIMPLE | ||
| #define HYPERCALL2 HYPERCALL_SIMPLE | ||
| #define HYPERCALL3 HYPERCALL_SIMPLE | ||
| #define HYPERCALL4 HYPERCALL_SIMPLE | ||
| #define HYPERCALL5 HYPERCALL_SIMPLE | ||
|
|
||
| .text | ||
|
|
||
| HYPERCALL2(xen_version); | ||
| HYPERCALL3(console_io); | ||
| HYPERCALL3(grant_table_op); | ||
| HYPERCALL2(sched_op); | ||
| HYPERCALL2(event_channel_op); | ||
| HYPERCALL2(hvm_op); | ||
| HYPERCALL2(memory_op); | ||
| HYPERCALL2(physdev_op); | ||
| HYPERCALL3(vcpu_op); | ||
| HYPERCALL1(tmem_op); | ||
| HYPERCALL2(multicall); | ||
| HYPERCALL2(vm_assist); | ||
| HYPERCALL1(sysctl); | ||
| HYPERCALL1(domctl); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same comments as for the 32-bit version
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please check my comment for arm32 |
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -7,30 +7,29 @@ | |
| #define XTF_ARM_HYPERCALL_H | ||
|
|
||
| #include <xtf/lib.h> | ||
| #include <arch/desc.h> | ||
| #include <arch/page.h> | ||
| #include <xen/sysctl.h> | ||
|
|
||
| #define _hypercall_1(type, hcall, a1) \ | ||
| ({ \ | ||
| UNIMPLEMENTED(); \ | ||
| (type)0; \ | ||
| }) | ||
| int hypercall_memory_op(unsigned int cmd, void *arg); | ||
| int hypercall_domctl(unsigned long op); | ||
| int hypercall_sched_op(int cmd, void *arg); | ||
| int hypercall_console_io(int cmd, int count, char *str); | ||
| int hypercall_xen_version(int cmd, void *arg); | ||
| int hypercall_event_channel_op(int cmd, void *op); | ||
| int hypercall_physdev_op(void *physdev_op); | ||
| int hypercall_sysctl(xen_sysctl_t *arg); | ||
| int hypercall_hvm_op(unsigned long op, void *arg); | ||
| int hypercall_grant_table_op(unsigned int cmd, void *uop, unsigned int count); | ||
| int hypercall_vcpu_op(int cmd, int vcpuid, void *extra_args); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hypercall_argo_op should be added together with argo.h public interface. This shall be added when adding a test for argo. |
||
|
|
||
| #define _hypercall_2(type, hcall, a1, a2) \ | ||
| ({ \ | ||
| UNIMPLEMENTED(); \ | ||
| (type)0; \ | ||
| }) | ||
|
|
||
| #define _hypercall_3(type, hcall, a1, a2, a3) \ | ||
| ({ \ | ||
| UNIMPLEMENTED(); \ | ||
| (type)0; \ | ||
| }) | ||
|
|
||
| #define _hypercall_5(type, hcall, a1, a2, a3, a4, a5) \ | ||
| ({ \ | ||
| UNIMPLEMENTED(); \ | ||
| (type)0; \ | ||
| }) | ||
| /* | ||
| * Higher level hypercall helpers | ||
| */ | ||
| static inline void hypercall_console_write(const char *buf, size_t count) | ||
| { | ||
| (void)hypercall_console_io(CONSOLEIO_write, count, (char *)buf); | ||
| } | ||
|
|
||
| #endif /* XTF_ARM_HYPERCALL_H */ | ||
|
|
||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Both .S was borrowed from Linux right? If so, that's fine because the license is not GPL. But please retain the copyright from the author.