qemu with hax to log dma reads & writes jcs.org/2018/11/12/vfio

linux-user: create target_structs header to place ipc_perm and shmid_ds

Creating target_structs header in linux-user/$arch/ and making
target_ipc_perm and target_shmid_ds its first inhabitants.
The struct defintions may/should be further fine-tuned by arch maintainers.

Signed-off-by: Petar Jovanovic <petar.jovanovic@imgtec.com>
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>

authored by

Petar Jovanovic and committed by
Riku Voipio
55a2b163 9721cf2c

+963 -48
+58
linux-user/aarch64/target_structs.h
··· 1 + /* 2 + * ARM AArch64 specific structures for linux-user 3 + * 4 + * Copyright (c) 2013 Fabrice Bellard 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, see <http://www.gnu.org/licenses/>. 18 + */ 19 + #ifndef TARGET_STRUCTS_H 20 + #define TARGET_STRUCTS_H 21 + 22 + struct target_ipc_perm { 23 + abi_int __key; /* Key. */ 24 + abi_uint uid; /* Owner's user ID. */ 25 + abi_uint gid; /* Owner's group ID. */ 26 + abi_uint cuid; /* Creator's user ID. */ 27 + abi_uint cgid; /* Creator's group ID. */ 28 + abi_ushort mode; /* Read/write permission. */ 29 + abi_ushort __pad1; 30 + abi_ushort __seq; /* Sequence number. */ 31 + abi_ushort __pad2; 32 + abi_ulong __unused1; 33 + abi_ulong __unused2; 34 + }; 35 + 36 + struct target_shmid_ds { 37 + struct target_ipc_perm shm_perm; /* operation permission struct */ 38 + abi_long shm_segsz; /* size of segment in bytes */ 39 + abi_ulong shm_atime; /* time of last shmat() */ 40 + #if TARGET_ABI_BITS == 32 41 + abi_ulong __unused1; 42 + #endif 43 + abi_ulong shm_dtime; /* time of last shmdt() */ 44 + #if TARGET_ABI_BITS == 32 45 + abi_ulong __unused2; 46 + #endif 47 + abi_ulong shm_ctime; /* time of last change by shmctl() */ 48 + #if TARGET_ABI_BITS == 32 49 + abi_ulong __unused3; 50 + #endif 51 + abi_int shm_cpid; /* pid of creator */ 52 + abi_int shm_lpid; /* pid of last shmop */ 53 + abi_ulong shm_nattch; /* number of current attaches */ 54 + abi_ulong __unused4; 55 + abi_ulong __unused5; 56 + }; 57 + 58 + #endif
+48
linux-user/alpha/target_structs.h
··· 1 + /* 2 + * Alpha specific structures for linux-user 3 + * 4 + * Copyright (c) 2013 Fabrice Bellard 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, see <http://www.gnu.org/licenses/>. 18 + */ 19 + #ifndef TARGET_STRUCTS_H 20 + #define TARGET_STRUCTS_H 21 + 22 + struct target_ipc_perm { 23 + abi_int __key; /* Key. */ 24 + abi_uint uid; /* Owner's user ID. */ 25 + abi_uint gid; /* Owner's group ID. */ 26 + abi_uint cuid; /* Creator's user ID. */ 27 + abi_uint cgid; /* Creator's group ID. */ 28 + abi_uint mode; /* Read/write permission. */ 29 + abi_ushort __seq; /* Sequence number. */ 30 + abi_ushort __pad1; 31 + abi_ulong __unused1; 32 + abi_ulong __unused2; 33 + }; 34 + 35 + struct target_shmid_ds { 36 + struct target_ipc_perm shm_perm; /* operation permission struct */ 37 + abi_long shm_segsz; /* size of segment in bytes */ 38 + abi_ulong shm_atime; /* time of last shmat() */ 39 + abi_ulong shm_dtime; /* time of last shmdt() */ 40 + abi_ulong shm_ctime; /* time of last change by shmctl() */ 41 + abi_int shm_cpid; /* pid of creator */ 42 + abi_int shm_lpid; /* pid of last shmop */ 43 + abi_ulong shm_nattch; /* number of current attaches */ 44 + abi_ulong __unused1; 45 + abi_ulong __unused2; 46 + }; 47 + 48 + #endif
+52
linux-user/arm/target_structs.h
··· 1 + /* 2 + * ARM specific structures for linux-user 3 + * 4 + * Copyright (c) 2013 Fabrice Bellard 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, see <http://www.gnu.org/licenses/>. 18 + */ 19 + #ifndef TARGET_STRUCTS_H 20 + #define TARGET_STRUCTS_H 21 + 22 + struct target_ipc_perm { 23 + abi_int __key; /* Key. */ 24 + abi_uint uid; /* Owner's user ID. */ 25 + abi_uint gid; /* Owner's group ID. */ 26 + abi_uint cuid; /* Creator's user ID. */ 27 + abi_uint cgid; /* Creator's group ID. */ 28 + abi_ushort mode; /* Read/write permission. */ 29 + abi_ushort __pad1; 30 + abi_ushort __seq; /* Sequence number. */ 31 + abi_ushort __pad2; 32 + abi_ulong __unused1; 33 + abi_ulong __unused2; 34 + }; 35 + 36 + struct target_shmid_ds { 37 + struct target_ipc_perm shm_perm; /* operation permission struct */ 38 + abi_long shm_segsz; /* size of segment in bytes */ 39 + abi_ulong shm_atime; /* time of last shmat() */ 40 + abi_ulong __unused1; 41 + abi_ulong shm_dtime; /* time of last shmdt() */ 42 + abi_ulong __unused2; 43 + abi_ulong shm_ctime; /* time of last change by shmctl() */ 44 + abi_ulong __unused3; 45 + abi_int shm_cpid; /* pid of creator */ 46 + abi_int shm_lpid; /* pid of last shmop */ 47 + abi_ulong shm_nattch; /* number of current attaches */ 48 + abi_ulong __unused4; 49 + abi_ulong __unused5; 50 + }; 51 + 52 + #endif
+58
linux-user/cris/target_structs.h
··· 1 + /* 2 + * CRIS specific structures for linux-user 3 + * 4 + * Copyright (c) 2013 Fabrice Bellard 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, see <http://www.gnu.org/licenses/>. 18 + */ 19 + #ifndef TARGET_STRUCTS_H 20 + #define TARGET_STRUCTS_H 21 + 22 + struct target_ipc_perm { 23 + abi_int __key; /* Key. */ 24 + abi_uint uid; /* Owner's user ID. */ 25 + abi_uint gid; /* Owner's group ID. */ 26 + abi_uint cuid; /* Creator's user ID. */ 27 + abi_uint cgid; /* Creator's group ID. */ 28 + abi_ushort mode; /* Read/write permission. */ 29 + abi_ushort __pad1; 30 + abi_ushort __seq; /* Sequence number. */ 31 + abi_ushort __pad2; 32 + abi_ulong __unused1; 33 + abi_ulong __unused2; 34 + }; 35 + 36 + struct target_shmid_ds { 37 + struct target_ipc_perm shm_perm; /* operation permission struct */ 38 + abi_long shm_segsz; /* size of segment in bytes */ 39 + abi_ulong shm_atime; /* time of last shmat() */ 40 + #if TARGET_ABI_BITS == 32 41 + abi_ulong __unused1; 42 + #endif 43 + abi_ulong shm_dtime; /* time of last shmdt() */ 44 + #if TARGET_ABI_BITS == 32 45 + abi_ulong __unused2; 46 + #endif 47 + abi_ulong shm_ctime; /* time of last change by shmctl() */ 48 + #if TARGET_ABI_BITS == 32 49 + abi_ulong __unused3; 50 + #endif 51 + abi_int shm_cpid; /* pid of creator */ 52 + abi_int shm_lpid; /* pid of last shmop */ 53 + abi_ulong shm_nattch; /* number of current attaches */ 54 + abi_ulong __unused4; 55 + abi_ulong __unused5; 56 + }; 57 + 58 + #endif
+58
linux-user/i386/target_structs.h
··· 1 + /* 2 + * i386 specific structures for linux-user 3 + * 4 + * Copyright (c) 2013 Fabrice Bellard 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, see <http://www.gnu.org/licenses/>. 18 + */ 19 + #ifndef TARGET_STRUCTS_H 20 + #define TARGET_STRUCTS_H 21 + 22 + struct target_ipc_perm { 23 + abi_int __key; /* Key. */ 24 + abi_uint uid; /* Owner's user ID. */ 25 + abi_uint gid; /* Owner's group ID. */ 26 + abi_uint cuid; /* Creator's user ID. */ 27 + abi_uint cgid; /* Creator's group ID. */ 28 + abi_ushort mode; /* Read/write permission. */ 29 + abi_ushort __pad1; 30 + abi_ushort __seq; /* Sequence number. */ 31 + abi_ushort __pad2; 32 + abi_ulong __unused1; 33 + abi_ulong __unused2; 34 + }; 35 + 36 + struct target_shmid_ds { 37 + struct target_ipc_perm shm_perm; /* operation permission struct */ 38 + abi_long shm_segsz; /* size of segment in bytes */ 39 + abi_ulong shm_atime; /* time of last shmat() */ 40 + #if TARGET_ABI_BITS == 32 41 + abi_ulong __unused1; 42 + #endif 43 + abi_ulong shm_dtime; /* time of last shmdt() */ 44 + #if TARGET_ABI_BITS == 32 45 + abi_ulong __unused2; 46 + #endif 47 + abi_ulong shm_ctime; /* time of last change by shmctl() */ 48 + #if TARGET_ABI_BITS == 32 49 + abi_ulong __unused3; 50 + #endif 51 + abi_int shm_cpid; /* pid of creator */ 52 + abi_int shm_lpid; /* pid of last shmop */ 53 + abi_ulong shm_nattch; /* number of current attaches */ 54 + abi_ulong __unused4; 55 + abi_ulong __unused5; 56 + }; 57 + 58 + #endif
+58
linux-user/m68k/target_structs.h
··· 1 + /* 2 + * m68k specific structures for linux-user 3 + * 4 + * Copyright (c) 2013 Fabrice Bellard 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, see <http://www.gnu.org/licenses/>. 18 + */ 19 + #ifndef TARGET_STRUCTS_H 20 + #define TARGET_STRUCTS_H 21 + 22 + struct target_ipc_perm { 23 + abi_int __key; /* Key. */ 24 + abi_uint uid; /* Owner's user ID. */ 25 + abi_uint gid; /* Owner's group ID. */ 26 + abi_uint cuid; /* Creator's user ID. */ 27 + abi_uint cgid; /* Creator's group ID. */ 28 + abi_ushort mode; /* Read/write permission. */ 29 + abi_ushort __pad1; 30 + abi_ushort __seq; /* Sequence number. */ 31 + abi_ushort __pad2; 32 + abi_ulong __unused1; 33 + abi_ulong __unused2; 34 + }; 35 + 36 + struct target_shmid_ds { 37 + struct target_ipc_perm shm_perm; /* operation permission struct */ 38 + abi_long shm_segsz; /* size of segment in bytes */ 39 + abi_ulong shm_atime; /* time of last shmat() */ 40 + #if TARGET_ABI_BITS == 32 41 + abi_ulong __unused1; 42 + #endif 43 + abi_ulong shm_dtime; /* time of last shmdt() */ 44 + #if TARGET_ABI_BITS == 32 45 + abi_ulong __unused2; 46 + #endif 47 + abi_ulong shm_ctime; /* time of last change by shmctl() */ 48 + #if TARGET_ABI_BITS == 32 49 + abi_ulong __unused3; 50 + #endif 51 + abi_int shm_cpid; /* pid of creator */ 52 + abi_int shm_lpid; /* pid of last shmop */ 53 + abi_ulong shm_nattch; /* number of current attaches */ 54 + abi_ulong __unused4; 55 + abi_ulong __unused5; 56 + }; 57 + 58 + #endif
+58
linux-user/microblaze/target_structs.h
··· 1 + /* 2 + * MicroBlaze specific structures for linux-user 3 + * 4 + * Copyright (c) 2013 Fabrice Bellard 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, see <http://www.gnu.org/licenses/>. 18 + */ 19 + #ifndef TARGET_STRUCTS_H 20 + #define TARGET_STRUCTS_H 21 + 22 + struct target_ipc_perm { 23 + abi_int __key; /* Key. */ 24 + abi_uint uid; /* Owner's user ID. */ 25 + abi_uint gid; /* Owner's group ID. */ 26 + abi_uint cuid; /* Creator's user ID. */ 27 + abi_uint cgid; /* Creator's group ID. */ 28 + abi_ushort mode; /* Read/write permission. */ 29 + abi_ushort __pad1; 30 + abi_ushort __seq; /* Sequence number. */ 31 + abi_ushort __pad2; 32 + abi_ulong __unused1; 33 + abi_ulong __unused2; 34 + }; 35 + 36 + struct target_shmid_ds { 37 + struct target_ipc_perm shm_perm; /* operation permission struct */ 38 + abi_long shm_segsz; /* size of segment in bytes */ 39 + abi_ulong shm_atime; /* time of last shmat() */ 40 + #if TARGET_ABI_BITS == 32 41 + abi_ulong __unused1; 42 + #endif 43 + abi_ulong shm_dtime; /* time of last shmdt() */ 44 + #if TARGET_ABI_BITS == 32 45 + abi_ulong __unused2; 46 + #endif 47 + abi_ulong shm_ctime; /* time of last change by shmctl() */ 48 + #if TARGET_ABI_BITS == 32 49 + abi_ulong __unused3; 50 + #endif 51 + abi_int shm_cpid; /* pid of creator */ 52 + abi_int shm_lpid; /* pid of last shmop */ 53 + abi_ulong shm_nattch; /* number of current attaches */ 54 + abi_ulong __unused4; 55 + abi_ulong __unused5; 56 + }; 57 + 58 + #endif
+48
linux-user/mips/target_structs.h
··· 1 + /* 2 + * MIPS specific structures for linux-user 3 + * 4 + * Copyright (c) 2013 Fabrice Bellard 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, see <http://www.gnu.org/licenses/>. 18 + */ 19 + #ifndef TARGET_STRUCTS_H 20 + #define TARGET_STRUCTS_H 21 + 22 + struct target_ipc_perm { 23 + abi_int __key; /* Key. */ 24 + abi_uint uid; /* Owner's user ID. */ 25 + abi_uint gid; /* Owner's group ID. */ 26 + abi_uint cuid; /* Creator's user ID. */ 27 + abi_uint cgid; /* Creator's group ID. */ 28 + abi_uint mode; /* Read/write permission. */ 29 + abi_ushort __seq; /* Sequence number. */ 30 + abi_ushort __pad1; 31 + abi_ulong __unused1; 32 + abi_ulong __unused2; 33 + }; 34 + 35 + struct target_shmid_ds { 36 + struct target_ipc_perm shm_perm; /* operation permission struct */ 37 + abi_long shm_segsz; /* size of segment in bytes */ 38 + abi_ulong shm_atime; /* time of last shmat() */ 39 + abi_ulong shm_dtime; /* time of last shmdt() */ 40 + abi_ulong shm_ctime; /* time of last change by shmctl() */ 41 + abi_int shm_cpid; /* pid of creator */ 42 + abi_int shm_lpid; /* pid of last shmop */ 43 + abi_ulong shm_nattch; /* number of current attaches */ 44 + abi_ulong __unused1; 45 + abi_ulong __unused2; 46 + }; 47 + 48 + #endif
+18
linux-user/mips64/target_cpu.h
··· 1 + /* 2 + * MIPS64 specific structures for linux-user 3 + * 4 + * Copyright (c) 2013 Fabrice Bellard 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, see <http://www.gnu.org/licenses/>. 18 + */ 1 19 #include "../mips/target_cpu.h"
+2
linux-user/mips64/target_structs.h
··· 1 + #include "../mips/target_structs.h" 2 +
+58
linux-user/openrisc/target_structs.h
··· 1 + /* 2 + * OpenRISC specific structures for linux-user 3 + * 4 + * Copyright (c) 2013 Fabrice Bellard 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, see <http://www.gnu.org/licenses/>. 18 + */ 19 + #ifndef TARGET_STRUCTS_H 20 + #define TARGET_STRUCTS_H 21 + 22 + struct target_ipc_perm { 23 + abi_int __key; /* Key. */ 24 + abi_uint uid; /* Owner's user ID. */ 25 + abi_uint gid; /* Owner's group ID. */ 26 + abi_uint cuid; /* Creator's user ID. */ 27 + abi_uint cgid; /* Creator's group ID. */ 28 + abi_ushort mode; /* Read/write permission. */ 29 + abi_ushort __pad1; 30 + abi_ushort __seq; /* Sequence number. */ 31 + abi_ushort __pad2; 32 + abi_ulong __unused1; 33 + abi_ulong __unused2; 34 + }; 35 + 36 + struct target_shmid_ds { 37 + struct target_ipc_perm shm_perm; /* operation permission struct */ 38 + abi_long shm_segsz; /* size of segment in bytes */ 39 + abi_ulong shm_atime; /* time of last shmat() */ 40 + #if TARGET_ABI_BITS == 32 41 + abi_ulong __unused1; 42 + #endif 43 + abi_ulong shm_dtime; /* time of last shmdt() */ 44 + #if TARGET_ABI_BITS == 32 45 + abi_ulong __unused2; 46 + #endif 47 + abi_ulong shm_ctime; /* time of last change by shmctl() */ 48 + #if TARGET_ABI_BITS == 32 49 + abi_ulong __unused3; 50 + #endif 51 + abi_int shm_cpid; /* pid of creator */ 52 + abi_int shm_lpid; /* pid of last shmop */ 53 + abi_ulong shm_nattch; /* number of current attaches */ 54 + abi_ulong __unused4; 55 + abi_ulong __unused5; 56 + }; 57 + 58 + #endif
+60
linux-user/ppc/target_structs.h
··· 1 + /* 2 + * PowerPC specific structures for linux-user 3 + * 4 + * Copyright (c) 2013 Fabrice Bellard 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, see <http://www.gnu.org/licenses/>. 18 + */ 19 + #ifndef TARGET_STRUCTS_H 20 + #define TARGET_STRUCTS_H 21 + 22 + struct target_ipc_perm { 23 + abi_int __key; /* Key. */ 24 + abi_uint uid; /* Owner's user ID. */ 25 + abi_uint gid; /* Owner's group ID. */ 26 + abi_uint cuid; /* Creator's user ID. */ 27 + abi_uint cgid; /* Creator's group ID. */ 28 + abi_uint mode; /* Read/write permission. */ 29 + uint32_t __seq; /* Sequence number. */ 30 + uint32_t __pad1; 31 + uint64_t __unused1; 32 + uint64_t __unused2; 33 + }; 34 + 35 + struct target_shmid_ds { 36 + struct target_ipc_perm shm_perm; /* operation permission struct */ 37 + #if TARGET_ABI_BITS == 32 38 + abi_uint __unused1; 39 + #endif 40 + abi_ulong shm_atime; /* time of last shmat() */ 41 + #if TARGET_ABI_BITS == 32 42 + abi_uint __unused2; 43 + #endif 44 + abi_ulong shm_dtime; /* time of last shmdt() */ 45 + #if TARGET_ABI_BITS == 32 46 + abi_uint __unused3; 47 + #endif 48 + abi_ulong shm_ctime; /* time of last change by shmctl() */ 49 + #if TARGET_ABI_BITS == 32 50 + abi_uint __unused4; 51 + #endif 52 + abi_long shm_segsz; /* size of segment in bytes */ 53 + abi_int shm_cpid; /* pid of creator */ 54 + abi_int shm_lpid; /* pid of last shmop */ 55 + abi_ulong shm_nattch; /* number of current attaches */ 56 + abi_ulong __unused5; 57 + abi_ulong __unused6; 58 + }; 59 + 60 + #endif
+1
linux-user/qemu.h
··· 452 452 */ 453 453 #include "target_cpu.h" 454 454 #include "target_signal.h" 455 + #include "target_structs.h" 455 456 456 457 #endif /* QEMU_H */
+63
linux-user/s390x/target_structs.h
··· 1 + /* 2 + * S/390 specific structures for linux-user 3 + * 4 + * Copyright (c) 2013 Fabrice Bellard 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, see <http://www.gnu.org/licenses/>. 18 + */ 19 + #ifndef TARGET_STRUCTS_H 20 + #define TARGET_STRUCTS_H 21 + 22 + 23 + struct target_ipc_perm { 24 + abi_int __key; /* Key. */ 25 + abi_uint uid; /* Owner's user ID. */ 26 + abi_uint gid; /* Owner's group ID. */ 27 + abi_uint cuid; /* Creator's user ID. */ 28 + abi_uint cgid; /* Creator's group ID. */ 29 + #if TARGET_ABI_BITS == 64 30 + abi_uint mode; /* Read/write permission. */ 31 + #else 32 + abi_ushort mode; /* Read/write permission. */ 33 + abi_ushort __pad1; 34 + #endif 35 + abi_ushort __seq; /* Sequence number. */ 36 + abi_ushort __pad2; 37 + abi_ulong __unused1; 38 + abi_ulong __unused2; 39 + }; 40 + 41 + struct target_shmid_ds { 42 + struct target_ipc_perm shm_perm; /* operation permission struct */ 43 + abi_long shm_segsz; /* size of segment in bytes */ 44 + abi_ulong shm_atime; /* time of last shmat() */ 45 + #if TARGET_ABI_BITS == 32 46 + abi_ulong __unused1; 47 + #endif 48 + abi_ulong shm_dtime; /* time of last shmdt() */ 49 + #if TARGET_ABI_BITS == 32 50 + abi_ulong __unused2; 51 + #endif 52 + abi_ulong shm_ctime; /* time of last change by shmctl() */ 53 + #if TARGET_ABI_BITS == 32 54 + abi_ulong __unused3; 55 + #endif 56 + abi_int shm_cpid; /* pid of creator */ 57 + abi_int shm_lpid; /* pid of last shmop */ 58 + abi_ulong shm_nattch; /* number of current attaches */ 59 + abi_ulong __unused4; 60 + abi_ulong __unused5; 61 + }; 62 + 63 + #endif
+58
linux-user/sh4/target_structs.h
··· 1 + /* 2 + * SH4 specific structures for linux-user 3 + * 4 + * Copyright (c) 2013 Fabrice Bellard 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, see <http://www.gnu.org/licenses/>. 18 + */ 19 + #ifndef TARGET_STRUCTS_H 20 + #define TARGET_STRUCTS_H 21 + 22 + struct target_ipc_perm { 23 + abi_int __key; /* Key. */ 24 + abi_uint uid; /* Owner's user ID. */ 25 + abi_uint gid; /* Owner's group ID. */ 26 + abi_uint cuid; /* Creator's user ID. */ 27 + abi_uint cgid; /* Creator's group ID. */ 28 + abi_ushort mode; /* Read/write permission. */ 29 + abi_ushort __pad1; 30 + abi_ushort __seq; /* Sequence number. */ 31 + abi_ushort __pad2; 32 + abi_ulong __unused1; 33 + abi_ulong __unused2; 34 + }; 35 + 36 + struct target_shmid_ds { 37 + struct target_ipc_perm shm_perm; /* operation permission struct */ 38 + abi_long shm_segsz; /* size of segment in bytes */ 39 + abi_ulong shm_atime; /* time of last shmat() */ 40 + #if TARGET_ABI_BITS == 32 41 + abi_ulong __unused1; 42 + #endif 43 + abi_ulong shm_dtime; /* time of last shmdt() */ 44 + #if TARGET_ABI_BITS == 32 45 + abi_ulong __unused2; 46 + #endif 47 + abi_ulong shm_ctime; /* time of last change by shmctl() */ 48 + #if TARGET_ABI_BITS == 32 49 + abi_ulong __unused3; 50 + #endif 51 + abi_int shm_cpid; /* pid of creator */ 52 + abi_int shm_lpid; /* pid of last shmop */ 53 + abi_ulong shm_nattch; /* number of current attaches */ 54 + abi_ulong __unused4; 55 + abi_ulong __unused5; 56 + }; 57 + 58 + #endif
+63
linux-user/sparc/target_structs.h
··· 1 + /* 2 + * SPARC specific structures for linux-user 3 + * 4 + * Copyright (c) 2013 Fabrice Bellard 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, see <http://www.gnu.org/licenses/>. 18 + */ 19 + #ifndef TARGET_STRUCTS_H 20 + #define TARGET_STRUCTS_H 21 + 22 + struct target_ipc_perm { 23 + abi_int __key; /* Key. */ 24 + abi_uint uid; /* Owner's user ID. */ 25 + abi_uint gid; /* Owner's group ID. */ 26 + abi_uint cuid; /* Creator's user ID. */ 27 + abi_uint cgid; /* Creator's group ID. */ 28 + #if TARGET_ABI_BITS == 32 29 + abi_ushort __pad1; 30 + abi_ushort mode; /* Read/write permission. */ 31 + abi_ushort __pad2; 32 + #else 33 + abi_ushort mode; 34 + abi_ushort __pad1; 35 + #endif 36 + abi_ushort __seq; /* Sequence number. */ 37 + uint64_t __unused1; 38 + uint64_t __unused2; 39 + }; 40 + 41 + struct target_shmid_ds { 42 + struct target_ipc_perm shm_perm; /* operation permission struct */ 43 + #if TARGET_ABI_BITS == 32 44 + abi_uint __pad1; 45 + #endif 46 + abi_ulong shm_atime; /* time of last shmat() */ 47 + #if TARGET_ABI_BITS == 32 48 + abi_uint __pad2; 49 + #endif 50 + abi_ulong shm_dtime; /* time of last shmdt() */ 51 + #if TARGET_ABI_BITS == 32 52 + abi_uint __pad3; 53 + #endif 54 + abi_ulong shm_ctime; /* time of last change by shmctl() */ 55 + abi_long shm_segsz; /* size of segment in bytes */ 56 + abi_ulong shm_cpid; /* pid of creator */ 57 + abi_ulong shm_lpid; /* pid of last shmop */ 58 + abi_long shm_nattch; /* number of current attaches */ 59 + abi_ulong __unused1; 60 + abi_ulong __unused2; 61 + }; 62 + 63 + #endif
+58
linux-user/sparc64/target_structs.h
··· 1 + /* 2 + * SPARC64 specific structures for linux-user 3 + * 4 + * Copyright (c) 2013 Fabrice Bellard 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, see <http://www.gnu.org/licenses/>. 18 + */ 19 + #ifndef TARGET_STRUCTS_H 20 + #define TARGET_STRUCTS_H 21 + 22 + struct target_ipc_perm { 23 + abi_int __key; /* Key. */ 24 + abi_uint uid; /* Owner's user ID. */ 25 + abi_uint gid; /* Owner's group ID. */ 26 + abi_uint cuid; /* Creator's user ID. */ 27 + abi_uint cgid; /* Creator's group ID. */ 28 + abi_ushort mode; /* Read/write permission. */ 29 + abi_ushort __pad1; 30 + abi_ushort __seq; /* Sequence number. */ 31 + abi_ushort __pad2; 32 + abi_ulong __unused1; 33 + abi_ulong __unused2; 34 + }; 35 + 36 + struct target_shmid_ds { 37 + struct target_ipc_perm shm_perm; /* operation permission struct */ 38 + abi_long shm_segsz; /* size of segment in bytes */ 39 + abi_ulong shm_atime; /* time of last shmat() */ 40 + #if TARGET_ABI_BITS == 32 41 + abi_ulong __unused1; 42 + #endif 43 + abi_ulong shm_dtime; /* time of last shmdt() */ 44 + #if TARGET_ABI_BITS == 32 45 + abi_ulong __unused2; 46 + #endif 47 + abi_ulong shm_ctime; /* time of last change by shmctl() */ 48 + #if TARGET_ABI_BITS == 32 49 + abi_ulong __unused3; 50 + #endif 51 + abi_int shm_cpid; /* pid of creator */ 52 + abi_int shm_lpid; /* pid of last shmop */ 53 + abi_ulong shm_nattch; /* number of current attaches */ 54 + abi_ulong __unused4; 55 + abi_ulong __unused5; 56 + }; 57 + 58 + #endif
+28 -48
linux-user/syscall.c
··· 2436 2436 abi_ulong size; 2437 2437 } shm_regions[N_SHM_REGIONS]; 2438 2438 2439 - struct target_ipc_perm 2440 - { 2441 - abi_long __key; 2442 - abi_ulong uid; 2443 - abi_ulong gid; 2444 - abi_ulong cuid; 2445 - abi_ulong cgid; 2446 - unsigned short int mode; 2447 - unsigned short int __pad1; 2448 - unsigned short int __seq; 2449 - unsigned short int __pad2; 2450 - abi_ulong __unused1; 2451 - abi_ulong __unused2; 2452 - }; 2453 - 2454 2439 struct target_semid_ds 2455 2440 { 2456 2441 struct target_ipc_perm sem_perm; ··· 2472 2457 if (!lock_user_struct(VERIFY_READ, target_sd, target_addr, 1)) 2473 2458 return -TARGET_EFAULT; 2474 2459 target_ip = &(target_sd->sem_perm); 2475 - host_ip->__key = tswapal(target_ip->__key); 2476 - host_ip->uid = tswapal(target_ip->uid); 2477 - host_ip->gid = tswapal(target_ip->gid); 2478 - host_ip->cuid = tswapal(target_ip->cuid); 2479 - host_ip->cgid = tswapal(target_ip->cgid); 2460 + host_ip->__key = tswap32(target_ip->__key); 2461 + host_ip->uid = tswap32(target_ip->uid); 2462 + host_ip->gid = tswap32(target_ip->gid); 2463 + host_ip->cuid = tswap32(target_ip->cuid); 2464 + host_ip->cgid = tswap32(target_ip->cgid); 2465 + #if defined(TARGET_ALPHA) || defined(TARGET_MIPS) || defined(TARGET_PPC) 2466 + host_ip->mode = tswap32(target_ip->mode); 2467 + #else 2480 2468 host_ip->mode = tswap16(target_ip->mode); 2469 + #endif 2470 + #if defined(TARGET_PPC) 2471 + host_ip->__seq = tswap32(target_ip->__seq); 2472 + #else 2473 + host_ip->__seq = tswap16(target_ip->__seq); 2474 + #endif 2481 2475 unlock_user_struct(target_sd, target_addr, 0); 2482 2476 return 0; 2483 2477 } ··· 2491 2485 if (!lock_user_struct(VERIFY_WRITE, target_sd, target_addr, 0)) 2492 2486 return -TARGET_EFAULT; 2493 2487 target_ip = &(target_sd->sem_perm); 2494 - target_ip->__key = tswapal(host_ip->__key); 2495 - target_ip->uid = tswapal(host_ip->uid); 2496 - target_ip->gid = tswapal(host_ip->gid); 2497 - target_ip->cuid = tswapal(host_ip->cuid); 2498 - target_ip->cgid = tswapal(host_ip->cgid); 2488 + target_ip->__key = tswap32(host_ip->__key); 2489 + target_ip->uid = tswap32(host_ip->uid); 2490 + target_ip->gid = tswap32(host_ip->gid); 2491 + target_ip->cuid = tswap32(host_ip->cuid); 2492 + target_ip->cgid = tswap32(host_ip->cgid); 2493 + #if defined(TARGET_ALPHA) || defined(TARGET_MIPS) || defined(TARGET_PPC) 2494 + target_ip->mode = tswap32(host_ip->mode); 2495 + #else 2499 2496 target_ip->mode = tswap16(host_ip->mode); 2497 + #endif 2498 + #if defined(TARGET_PPC) 2499 + target_ip->__seq = tswap32(host_ip->__seq); 2500 + #else 2501 + target_ip->__seq = tswap16(host_ip->__seq); 2502 + #endif 2500 2503 unlock_user_struct(target_sd, target_addr, 1); 2501 2504 return 0; 2502 2505 } ··· 2926 2929 g_free(host_mb); 2927 2930 return ret; 2928 2931 } 2929 - 2930 - struct target_shmid_ds 2931 - { 2932 - struct target_ipc_perm shm_perm; 2933 - abi_ulong shm_segsz; 2934 - abi_ulong shm_atime; 2935 - #if TARGET_ABI_BITS == 32 2936 - abi_ulong __unused1; 2937 - #endif 2938 - abi_ulong shm_dtime; 2939 - #if TARGET_ABI_BITS == 32 2940 - abi_ulong __unused2; 2941 - #endif 2942 - abi_ulong shm_ctime; 2943 - #if TARGET_ABI_BITS == 32 2944 - abi_ulong __unused3; 2945 - #endif 2946 - int shm_cpid; 2947 - int shm_lpid; 2948 - abi_ulong shm_nattch; 2949 - unsigned long int __unused4; 2950 - unsigned long int __unused5; 2951 - }; 2952 2932 2953 2933 static inline abi_long target_to_host_shmid_ds(struct shmid_ds *host_sd, 2954 2934 abi_ulong target_addr)
+58
linux-user/unicore32/target_structs.h
··· 1 + /* 2 + * UniCore32 specific structures for linux-user 3 + * 4 + * Copyright (c) 2013 Fabrice Bellard 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, see <http://www.gnu.org/licenses/>. 18 + */ 19 + #ifndef TARGET_STRUCTS_H 20 + #define TARGET_STRUCTS_H 21 + 22 + struct target_ipc_perm { 23 + abi_int __key; /* Key. */ 24 + abi_uint uid; /* Owner's user ID. */ 25 + abi_uint gid; /* Owner's group ID. */ 26 + abi_uint cuid; /* Creator's user ID. */ 27 + abi_uint cgid; /* Creator's group ID. */ 28 + abi_ushort mode; /* Read/write permission. */ 29 + abi_ushort __pad1; 30 + abi_ushort __seq; /* Sequence number. */ 31 + abi_ushort __pad2; 32 + abi_ulong __unused1; 33 + abi_ulong __unused2; 34 + }; 35 + 36 + struct target_shmid_ds { 37 + struct target_ipc_perm shm_perm; /* operation permission struct */ 38 + abi_long shm_segsz; /* size of segment in bytes */ 39 + abi_ulong shm_atime; /* time of last shmat() */ 40 + #if TARGET_ABI_BITS == 32 41 + abi_ulong __unused1; 42 + #endif 43 + abi_ulong shm_dtime; /* time of last shmdt() */ 44 + #if TARGET_ABI_BITS == 32 45 + abi_ulong __unused2; 46 + #endif 47 + abi_ulong shm_ctime; /* time of last change by shmctl() */ 48 + #if TARGET_ABI_BITS == 32 49 + abi_ulong __unused3; 50 + #endif 51 + abi_int shm_cpid; /* pid of creator */ 52 + abi_int shm_lpid; /* pid of last shmop */ 53 + abi_ulong shm_nattch; /* number of current attaches */ 54 + abi_ulong __unused4; 55 + abi_ulong __unused5; 56 + }; 57 + 58 + #endif
+58
linux-user/x86_64/target_structs.h
··· 1 + /* 2 + * X86-64 specific structures for linux-user 3 + * 4 + * Copyright (c) 2013 Fabrice Bellard 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, see <http://www.gnu.org/licenses/>. 18 + */ 19 + #ifndef TARGET_STRUCTS_H 20 + #define TARGET_STRUCTS_H 21 + 22 + struct target_ipc_perm { 23 + abi_int __key; /* Key. */ 24 + abi_uint uid; /* Owner's user ID. */ 25 + abi_uint gid; /* Owner's group ID. */ 26 + abi_uint cuid; /* Creator's user ID. */ 27 + abi_uint cgid; /* Creator's group ID. */ 28 + abi_ushort mode; /* Read/write permission. */ 29 + abi_ushort __pad1; 30 + abi_ushort __seq; /* Sequence number. */ 31 + abi_ushort __pad2; 32 + abi_ulong __unused1; 33 + abi_ulong __unused2; 34 + }; 35 + 36 + struct target_shmid_ds { 37 + struct target_ipc_perm shm_perm; /* operation permission struct */ 38 + abi_long shm_segsz; /* size of segment in bytes */ 39 + abi_ulong shm_atime; /* time of last shmat() */ 40 + #if TARGET_ABI_BITS == 32 41 + abi_ulong __unused1; 42 + #endif 43 + abi_ulong shm_dtime; /* time of last shmdt() */ 44 + #if TARGET_ABI_BITS == 32 45 + abi_ulong __unused2; 46 + #endif 47 + abi_ulong shm_ctime; /* time of last change by shmctl() */ 48 + #if TARGET_ABI_BITS == 32 49 + abi_ulong __unused3; 50 + #endif 51 + abi_int shm_cpid; /* pid of creator */ 52 + abi_int shm_lpid; /* pid of last shmop */ 53 + abi_ulong shm_nattch; /* number of current attaches */ 54 + abi_ulong __unused4; 55 + abi_ulong __unused5; 56 + }; 57 + 58 + #endif