diff options
author | Alexander Graf <agraf@suse.de> | 2012-10-27 13:26:14 -0400 |
---|---|---|
committer | Alexander Graf <agraf@suse.de> | 2012-10-30 05:54:52 -0400 |
commit | c99ec973a63e2249020d6d93a46d7572432da6a2 (patch) | |
tree | 18dc7e442a78f9a63b17c5c955f7e8e470b906cc | |
parent | 388cf9ee3c751c3a4cf8776987143354d6d8c797 (diff) |
PPC: ePAPR: Convert header to uapi
The new uapi framework splits kernel internal and user space exported
bits of header files more cleanly. Adjust the ePAPR header accordingly.
Signed-off-by: Alexander Graf <agraf@suse.de>
-rw-r--r-- | arch/powerpc/include/asm/Kbuild | 1 | ||||
-rw-r--r-- | arch/powerpc/include/asm/epapr_hcalls.h | 55 | ||||
-rw-r--r-- | arch/powerpc/include/uapi/asm/Kbuild | 1 | ||||
-rw-r--r-- | arch/powerpc/include/uapi/asm/epapr_hcalls.h | 98 |
4 files changed, 100 insertions, 55 deletions
diff --git a/arch/powerpc/include/asm/Kbuild b/arch/powerpc/include/asm/Kbuild index 13d6b7bf3b69..7e313f1ed183 100644 --- a/arch/powerpc/include/asm/Kbuild +++ b/arch/powerpc/include/asm/Kbuild | |||
@@ -34,6 +34,5 @@ header-y += termios.h | |||
34 | header-y += types.h | 34 | header-y += types.h |
35 | header-y += ucontext.h | 35 | header-y += ucontext.h |
36 | header-y += unistd.h | 36 | header-y += unistd.h |
37 | header-y += epapr_hcalls.h | ||
38 | 37 | ||
39 | generic-y += rwsem.h | 38 | generic-y += rwsem.h |
diff --git a/arch/powerpc/include/asm/epapr_hcalls.h b/arch/powerpc/include/asm/epapr_hcalls.h index b8d94459a929..58997afcd085 100644 --- a/arch/powerpc/include/asm/epapr_hcalls.h +++ b/arch/powerpc/include/asm/epapr_hcalls.h | |||
@@ -50,60 +50,7 @@ | |||
50 | #ifndef _EPAPR_HCALLS_H | 50 | #ifndef _EPAPR_HCALLS_H |
51 | #define _EPAPR_HCALLS_H | 51 | #define _EPAPR_HCALLS_H |
52 | 52 | ||
53 | #define EV_BYTE_CHANNEL_SEND 1 | 53 | #include <uapi/asm/epapr_hcalls.h> |
54 | #define EV_BYTE_CHANNEL_RECEIVE 2 | ||
55 | #define EV_BYTE_CHANNEL_POLL 3 | ||
56 | #define EV_INT_SET_CONFIG 4 | ||
57 | #define EV_INT_GET_CONFIG 5 | ||
58 | #define EV_INT_SET_MASK 6 | ||
59 | #define EV_INT_GET_MASK 7 | ||
60 | #define EV_INT_IACK 9 | ||
61 | #define EV_INT_EOI 10 | ||
62 | #define EV_INT_SEND_IPI 11 | ||
63 | #define EV_INT_SET_TASK_PRIORITY 12 | ||
64 | #define EV_INT_GET_TASK_PRIORITY 13 | ||
65 | #define EV_DOORBELL_SEND 14 | ||
66 | #define EV_MSGSND 15 | ||
67 | #define EV_IDLE 16 | ||
68 | |||
69 | /* vendor ID: epapr */ | ||
70 | #define EV_LOCAL_VENDOR_ID 0 /* for private use */ | ||
71 | #define EV_EPAPR_VENDOR_ID 1 | ||
72 | #define EV_FSL_VENDOR_ID 2 /* Freescale Semiconductor */ | ||
73 | #define EV_IBM_VENDOR_ID 3 /* IBM */ | ||
74 | #define EV_GHS_VENDOR_ID 4 /* Green Hills Software */ | ||
75 | #define EV_ENEA_VENDOR_ID 5 /* Enea */ | ||
76 | #define EV_WR_VENDOR_ID 6 /* Wind River Systems */ | ||
77 | #define EV_AMCC_VENDOR_ID 7 /* Applied Micro Circuits */ | ||
78 | #define EV_KVM_VENDOR_ID 42 /* KVM */ | ||
79 | |||
80 | /* The max number of bytes that a byte channel can send or receive per call */ | ||
81 | #define EV_BYTE_CHANNEL_MAX_BYTES 16 | ||
82 | |||
83 | |||
84 | #define _EV_HCALL_TOKEN(id, num) (((id) << 16) | (num)) | ||
85 | #define EV_HCALL_TOKEN(hcall_num) _EV_HCALL_TOKEN(EV_EPAPR_VENDOR_ID, hcall_num) | ||
86 | |||
87 | /* epapr return codes */ | ||
88 | #define EV_SUCCESS 0 | ||
89 | #define EV_EPERM 1 /* Operation not permitted */ | ||
90 | #define EV_ENOENT 2 /* Entry Not Found */ | ||
91 | #define EV_EIO 3 /* I/O error occured */ | ||
92 | #define EV_EAGAIN 4 /* The operation had insufficient | ||
93 | * resources to complete and should be | ||
94 | * retried | ||
95 | */ | ||
96 | #define EV_ENOMEM 5 /* There was insufficient memory to | ||
97 | * complete the operation */ | ||
98 | #define EV_EFAULT 6 /* Bad guest address */ | ||
99 | #define EV_ENODEV 7 /* No such device */ | ||
100 | #define EV_EINVAL 8 /* An argument supplied to the hcall | ||
101 | was out of range or invalid */ | ||
102 | #define EV_INTERNAL 9 /* An internal error occured */ | ||
103 | #define EV_CONFIG 10 /* A configuration error was detected */ | ||
104 | #define EV_INVALID_STATE 11 /* The object is in an invalid state */ | ||
105 | #define EV_UNIMPLEMENTED 12 /* Unimplemented hypercall */ | ||
106 | #define EV_BUFFER_OVERFLOW 13 /* Caller-supplied buffer too small */ | ||
107 | 54 | ||
108 | #ifndef __ASSEMBLY__ | 55 | #ifndef __ASSEMBLY__ |
109 | #include <linux/types.h> | 56 | #include <linux/types.h> |
diff --git a/arch/powerpc/include/uapi/asm/Kbuild b/arch/powerpc/include/uapi/asm/Kbuild index baebb3da1d44..e6b5be86e4fa 100644 --- a/arch/powerpc/include/uapi/asm/Kbuild +++ b/arch/powerpc/include/uapi/asm/Kbuild | |||
@@ -1,3 +1,4 @@ | |||
1 | # UAPI Header export list | 1 | # UAPI Header export list |
2 | include include/uapi/asm-generic/Kbuild.asm | 2 | include include/uapi/asm-generic/Kbuild.asm |
3 | 3 | ||
4 | header-y += epapr_hcalls.h | ||
diff --git a/arch/powerpc/include/uapi/asm/epapr_hcalls.h b/arch/powerpc/include/uapi/asm/epapr_hcalls.h new file mode 100644 index 000000000000..046c79364f83 --- /dev/null +++ b/arch/powerpc/include/uapi/asm/epapr_hcalls.h | |||
@@ -0,0 +1,98 @@ | |||
1 | /* | ||
2 | * ePAPR hcall interface | ||
3 | * | ||
4 | * Copyright 2008-2011 Freescale Semiconductor, Inc. | ||
5 | * | ||
6 | * Author: Timur Tabi <timur@freescale.com> | ||
7 | * | ||
8 | * This file is provided under a dual BSD/GPL license. When using or | ||
9 | * redistributing this file, you may do so under either license. | ||
10 | * | ||
11 | * Redistribution and use in source and binary forms, with or without | ||
12 | * modification, are permitted provided that the following conditions are met: | ||
13 | * * Redistributions of source code must retain the above copyright | ||
14 | * notice, this list of conditions and the following disclaimer. | ||
15 | * * Redistributions in binary form must reproduce the above copyright | ||
16 | * notice, this list of conditions and the following disclaimer in the | ||
17 | * documentation and/or other materials provided with the distribution. | ||
18 | * * Neither the name of Freescale Semiconductor nor the | ||
19 | * names of its contributors may be used to endorse or promote products | ||
20 | * derived from this software without specific prior written permission. | ||
21 | * | ||
22 | * | ||
23 | * ALTERNATIVELY, this software may be distributed under the terms of the | ||
24 | * GNU General Public License ("GPL") as published by the Free Software | ||
25 | * Foundation, either version 2 of that License or (at your option) any | ||
26 | * later version. | ||
27 | * | ||
28 | * THIS SOFTWARE IS PROVIDED BY Freescale Semiconductor ``AS IS'' AND ANY | ||
29 | * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED | ||
30 | * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE | ||
31 | * DISCLAIMED. IN NO EVENT SHALL Freescale Semiconductor BE LIABLE FOR ANY | ||
32 | * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES | ||
33 | * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; | ||
34 | * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND | ||
35 | * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT | ||
36 | * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS | ||
37 | * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
38 | */ | ||
39 | |||
40 | #ifndef _UAPI__EPAPR_HCALLS_H | ||
41 | #define _UAPI__EPAPR_HCALLS_H | ||
42 | |||
43 | #define EV_BYTE_CHANNEL_SEND 1 | ||
44 | #define EV_BYTE_CHANNEL_RECEIVE 2 | ||
45 | #define EV_BYTE_CHANNEL_POLL 3 | ||
46 | #define EV_INT_SET_CONFIG 4 | ||
47 | #define EV_INT_GET_CONFIG 5 | ||
48 | #define EV_INT_SET_MASK 6 | ||
49 | #define EV_INT_GET_MASK 7 | ||
50 | #define EV_INT_IACK 9 | ||
51 | #define EV_INT_EOI 10 | ||
52 | #define EV_INT_SEND_IPI 11 | ||
53 | #define EV_INT_SET_TASK_PRIORITY 12 | ||
54 | #define EV_INT_GET_TASK_PRIORITY 13 | ||
55 | #define EV_DOORBELL_SEND 14 | ||
56 | #define EV_MSGSND 15 | ||
57 | #define EV_IDLE 16 | ||
58 | |||
59 | /* vendor ID: epapr */ | ||
60 | #define EV_LOCAL_VENDOR_ID 0 /* for private use */ | ||
61 | #define EV_EPAPR_VENDOR_ID 1 | ||
62 | #define EV_FSL_VENDOR_ID 2 /* Freescale Semiconductor */ | ||
63 | #define EV_IBM_VENDOR_ID 3 /* IBM */ | ||
64 | #define EV_GHS_VENDOR_ID 4 /* Green Hills Software */ | ||
65 | #define EV_ENEA_VENDOR_ID 5 /* Enea */ | ||
66 | #define EV_WR_VENDOR_ID 6 /* Wind River Systems */ | ||
67 | #define EV_AMCC_VENDOR_ID 7 /* Applied Micro Circuits */ | ||
68 | #define EV_KVM_VENDOR_ID 42 /* KVM */ | ||
69 | |||
70 | /* The max number of bytes that a byte channel can send or receive per call */ | ||
71 | #define EV_BYTE_CHANNEL_MAX_BYTES 16 | ||
72 | |||
73 | |||
74 | #define _EV_HCALL_TOKEN(id, num) (((id) << 16) | (num)) | ||
75 | #define EV_HCALL_TOKEN(hcall_num) _EV_HCALL_TOKEN(EV_EPAPR_VENDOR_ID, hcall_num) | ||
76 | |||
77 | /* epapr return codes */ | ||
78 | #define EV_SUCCESS 0 | ||
79 | #define EV_EPERM 1 /* Operation not permitted */ | ||
80 | #define EV_ENOENT 2 /* Entry Not Found */ | ||
81 | #define EV_EIO 3 /* I/O error occured */ | ||
82 | #define EV_EAGAIN 4 /* The operation had insufficient | ||
83 | * resources to complete and should be | ||
84 | * retried | ||
85 | */ | ||
86 | #define EV_ENOMEM 5 /* There was insufficient memory to | ||
87 | * complete the operation */ | ||
88 | #define EV_EFAULT 6 /* Bad guest address */ | ||
89 | #define EV_ENODEV 7 /* No such device */ | ||
90 | #define EV_EINVAL 8 /* An argument supplied to the hcall | ||
91 | was out of range or invalid */ | ||
92 | #define EV_INTERNAL 9 /* An internal error occured */ | ||
93 | #define EV_CONFIG 10 /* A configuration error was detected */ | ||
94 | #define EV_INVALID_STATE 11 /* The object is in an invalid state */ | ||
95 | #define EV_UNIMPLEMENTED 12 /* Unimplemented hypercall */ | ||
96 | #define EV_BUFFER_OVERFLOW 13 /* Caller-supplied buffer too small */ | ||
97 | |||
98 | #endif /* _UAPI__EPAPR_HCALLS_H */ | ||