diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-17 00:19:45 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-17 00:19:45 -0400 |
commit | e0f88db3028798b5e6d62d1c65c991240bf317f3 (patch) | |
tree | ca6153883c115108967428ad70b023a6190e889e /include | |
parent | 43c0f3d25c602dc96b201ed81ffda0bc600ff969 (diff) | |
parent | c7754d465b1feade85b5f1c4492781a30f6652a2 (diff) |
Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/davem/sparc-2.6:
[SPARC64]: Add hypervisor API negotiation and fix console bugs.
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-sparc64/hypervisor.h | 83 |
1 files changed, 82 insertions, 1 deletions
diff --git a/include/asm-sparc64/hypervisor.h b/include/asm-sparc64/hypervisor.h index 612bf319753f..a5558c87556d 100644 --- a/include/asm-sparc64/hypervisor.h +++ b/include/asm-sparc64/hypervisor.h | |||
@@ -940,6 +940,54 @@ struct hv_fault_status { | |||
940 | */ | 940 | */ |
941 | #define HV_FAST_CONS_PUTCHAR 0x61 | 941 | #define HV_FAST_CONS_PUTCHAR 0x61 |
942 | 942 | ||
943 | /* con_read() | ||
944 | * TRAP: HV_FAST_TRAP | ||
945 | * FUNCTION: HV_FAST_CONS_READ | ||
946 | * ARG0: buffer real address | ||
947 | * ARG1: buffer size in bytes | ||
948 | * RET0: status | ||
949 | * RET1: bytes read or BREAK or HUP | ||
950 | * ERRORS: EWOULDBLOCK No character available. | ||
951 | * | ||
952 | * Reads characters into a buffer from the console device. If no | ||
953 | * character is available then an EWOULDBLOCK error is returned. | ||
954 | * If a character is available, then the returned status is EOK | ||
955 | * and the number of bytes read into the given buffer is provided | ||
956 | * in RET1. | ||
957 | * | ||
958 | * A virtual BREAK is represented by the 64-bit RET1 value -1. | ||
959 | * | ||
960 | * A virtual HUP signal is represented by the 64-bit RET1 value -2. | ||
961 | * | ||
962 | * If BREAK or HUP are indicated, no bytes were read into buffer. | ||
963 | */ | ||
964 | #define HV_FAST_CONS_READ 0x62 | ||
965 | |||
966 | /* con_write() | ||
967 | * TRAP: HV_FAST_TRAP | ||
968 | * FUNCTION: HV_FAST_CONS_WRITE | ||
969 | * ARG0: buffer real address | ||
970 | * ARG1: buffer size in bytes | ||
971 | * RET0: status | ||
972 | * RET1: bytes written | ||
973 | * ERRORS: EWOULDBLOCK Output buffer currently full, would block | ||
974 | * | ||
975 | * Send a characters in buffer to the console device. Breaks must be | ||
976 | * sent using con_putchar(). | ||
977 | */ | ||
978 | #define HV_FAST_CONS_WRITE 0x63 | ||
979 | |||
980 | #ifndef __ASSEMBLY__ | ||
981 | extern long sun4v_con_getchar(long *status); | ||
982 | extern long sun4v_con_putchar(long c); | ||
983 | extern long sun4v_con_read(unsigned long buffer, | ||
984 | unsigned long size, | ||
985 | unsigned long *bytes_read); | ||
986 | extern unsigned long sun4v_con_write(unsigned long buffer, | ||
987 | unsigned long size, | ||
988 | unsigned long *bytes_written); | ||
989 | #endif | ||
990 | |||
943 | /* Trap trace services. | 991 | /* Trap trace services. |
944 | * | 992 | * |
945 | * The hypervisor provides a trap tracing capability for privileged | 993 | * The hypervisor provides a trap tracing capability for privileged |
@@ -2121,8 +2169,41 @@ struct hv_mmu_statistics { | |||
2121 | #define HV_FAST_MMUSTAT_INFO 0x103 | 2169 | #define HV_FAST_MMUSTAT_INFO 0x103 |
2122 | 2170 | ||
2123 | /* Function numbers for HV_CORE_TRAP. */ | 2171 | /* Function numbers for HV_CORE_TRAP. */ |
2124 | #define HV_CORE_VER 0x00 | 2172 | #define HV_CORE_SET_VER 0x00 |
2125 | #define HV_CORE_PUTCHAR 0x01 | 2173 | #define HV_CORE_PUTCHAR 0x01 |
2126 | #define HV_CORE_EXIT 0x02 | 2174 | #define HV_CORE_EXIT 0x02 |
2175 | #define HV_CORE_GET_VER 0x03 | ||
2176 | |||
2177 | /* Hypervisor API groups for use with HV_CORE_SET_VER and | ||
2178 | * HV_CORE_GET_VER. | ||
2179 | */ | ||
2180 | #define HV_GRP_SUN4V 0x0000 | ||
2181 | #define HV_GRP_CORE 0x0001 | ||
2182 | #define HV_GRP_INTR 0x0002 | ||
2183 | #define HV_GRP_SOFT_STATE 0x0003 | ||
2184 | #define HV_GRP_PCI 0x0100 | ||
2185 | #define HV_GRP_LDOM 0x0101 | ||
2186 | #define HV_GRP_SVC_CHAN 0x0102 | ||
2187 | #define HV_GRP_NCS 0x0103 | ||
2188 | #define HV_GRP_NIAG_PERF 0x0200 | ||
2189 | #define HV_GRP_FIRE_PERF 0x0201 | ||
2190 | #define HV_GRP_DIAG 0x0300 | ||
2191 | |||
2192 | #ifndef __ASSEMBLY__ | ||
2193 | extern unsigned long sun4v_get_version(unsigned long group, | ||
2194 | unsigned long *major, | ||
2195 | unsigned long *minor); | ||
2196 | extern unsigned long sun4v_set_version(unsigned long group, | ||
2197 | unsigned long major, | ||
2198 | unsigned long minor, | ||
2199 | unsigned long *actual_minor); | ||
2200 | |||
2201 | extern int sun4v_hvapi_register(unsigned long group, unsigned long major, | ||
2202 | unsigned long *minor); | ||
2203 | extern void sun4v_hvapi_unregister(unsigned long group); | ||
2204 | extern int sun4v_hvapi_get(unsigned long group, | ||
2205 | unsigned long *major, | ||
2206 | unsigned long *minor); | ||
2207 | #endif | ||
2127 | 2208 | ||
2128 | #endif /* !(_SPARC64_HYPERVISOR_H) */ | 2209 | #endif /* !(_SPARC64_HYPERVISOR_H) */ |