]> git.proxmox.com Git - qemu.git/blob - linux-user/ppc64/syscall.h
Support for 32 bit ABI on 64 bit targets (only enabled Sparc64)
[qemu.git] / linux-user / ppc64 / syscall.h
1 /*
2 * PPC emulation for qemu: syscall definitions.
3 *
4 * Copyright (c) 2003 Jocelyn Mayer
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20
21 /* XXX: ABSOLUTELY BUGGY:
22 * for now, this is quite just a cut-and-paste from i386 target...
23 */
24
25 /* default linux values for the selectors */
26 #define __USER_DS (1)
27
28 struct target_pt_regs {
29 unsigned long gpr[32];
30 unsigned long nip;
31 unsigned long msr;
32 unsigned long orig_gpr3; /* Used for restarting system calls */
33 unsigned long ctr;
34 unsigned long link;
35 unsigned long xer;
36 unsigned long ccr;
37 unsigned long mq; /* 601 only (not used at present) */
38 /* Used on APUS to hold IPL value. */
39 unsigned long trap; /* Reason for being here */
40 unsigned long dar; /* Fault registers */
41 unsigned long dsisr;
42 unsigned long result; /* Result of a system call */
43 };
44
45 /* ioctls */
46 struct target_revectored_struct {
47 abi_ulong __map[8]; /* 256 bits */
48 };
49
50 /*
51 * flags masks
52 */
53
54 /* ipcs */
55
56 #define TARGET_SEMOP 1
57 #define TARGET_SEMGET 2
58 #define TARGET_SEMCTL 3
59 #define TARGET_MSGSND 11
60 #define TARGET_MSGRCV 12
61 #define TARGET_MSGGET 13
62 #define TARGET_MSGCTL 14
63 #define TARGET_SHMAT 21
64 #define TARGET_SHMDT 22
65 #define TARGET_SHMGET 23
66 #define TARGET_SHMCTL 24
67
68 #if 0 // To make it compile, even if the definition in syscall.c is bugged
69 struct target_msgbuf {
70 int mtype;
71 char mtext[1];
72 };
73 #endif
74
75 struct target_ipc_kludge {
76 unsigned int msgp; /* Really (struct msgbuf *) */
77 int msgtyp;
78 };
79
80 #if 0 // To make it compile, even if the definition in syscall.c is bugged
81 struct target_ipc_perm {
82 int __key;
83 unsigned short uid;
84 unsigned short gid;
85 unsigned short cuid;
86 unsigned short cgid;
87 unsigned short mode;
88 unsigned short seq;
89 };
90 #endif
91
92 #if 0 // To make it compile, even if the definition in syscall.c is bugged
93 struct target_msqid_ds {
94 struct target_ipc_perm msg_perm;
95 unsigned int msg_first; /* really struct target_msg* */
96 unsigned int msg_last; /* really struct target_msg* */
97 unsigned int msg_stime; /* really target_time_t */
98 unsigned int msg_rtime; /* really target_time_t */
99 unsigned int msg_ctime; /* really target_time_t */
100 unsigned int wwait; /* really struct wait_queue* */
101 unsigned int rwait; /* really struct wait_queue* */
102 unsigned short msg_cbytes;
103 unsigned short msg_qnum;
104 unsigned short msg_qbytes;
105 unsigned short msg_lspid;
106 unsigned short msg_lrpid;
107 };
108 #endif
109
110 #if 0 // To make it compile, even if the definition in syscall.c is bugged
111 struct target_shmid_ds {
112 struct target_ipc_perm shm_perm;
113 int shm_segsz;
114 unsigned int shm_atime; /* really target_time_t */
115 unsigned int shm_dtime; /* really target_time_t */
116 unsigned int shm_ctime; /* really target_time_t */
117 unsigned short shm_cpid;
118 unsigned short shm_lpid;
119 short shm_nattch;
120 unsigned short shm_npages;
121 unsigned long *shm_pages;
122 void *attaches; /* really struct shm_desc * */
123 };
124 #endif
125
126 #define TARGET_IPC_RMID 0
127 #define TARGET_IPC_SET 1
128 #define TARGET_IPC_STAT 2
129
130 #define UNAME_MACHINE "ppc64"