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

linux-user: move generic fcntl definitions to generic/fcntl.h

add a per target target_fcntl.h and include the generic one from them

No code change.

Signed-off-by: Laurent Vivier <laurent@vivier.eu>
Message-Id: <20180529194207.31503-2-laurent@vivier.eu>

+363 -128
+11
linux-user/aarch64/target_fcntl.h
··· 1 + /* 2 + * This program is free software; you can redistribute it and/or modify 3 + * it under the terms of the GNU General Public License version 2 as 4 + * published by the Free Software Foundation, or (at your option) any 5 + * later version. See the COPYING file in the top-level directory. 6 + */ 7 + 8 + #ifndef AARCH64_TARGET_FCNTL_H 9 + #define AARCH64_TARGET_FCNTL_H 10 + #include "../generic/fcntl.h" 11 + #endif
+11
linux-user/alpha/target_fcntl.h
··· 1 + /* 2 + * This program is free software; you can redistribute it and/or modify 3 + * it under the terms of the GNU General Public License version 2 as 4 + * published by the Free Software Foundation, or (at your option) any 5 + * later version. See the COPYING file in the top-level directory. 6 + */ 7 + 8 + #ifndef ALPHA_TARGET_FCNTL_H 9 + #define ALPHA_TARGET_FCNTL_H 10 + #include "../generic/fcntl.h" 11 + #endif
+11
linux-user/arm/target_fcntl.h
··· 1 + /* 2 + * This program is free software; you can redistribute it and/or modify 3 + * it under the terms of the GNU General Public License version 2 as 4 + * published by the Free Software Foundation, or (at your option) any 5 + * later version. See the COPYING file in the top-level directory. 6 + */ 7 + 8 + #ifndef ARM_TARGET_FCNTL_H 9 + #define ARM_TARGET_FCNTL_H 10 + #include "../generic/fcntl.h" 11 + #endif
+11
linux-user/cris/target_fcntl.h
··· 1 + /* 2 + * This program is free software; you can redistribute it and/or modify 3 + * it under the terms of the GNU General Public License version 2 as 4 + * published by the Free Software Foundation, or (at your option) any 5 + * later version. See the COPYING file in the top-level directory. 6 + */ 7 + 8 + #ifndef CRIS_TARGET_FCNTL_H 9 + #define CRIS_TARGET_FCNTL_H 10 + #include "../generic/fcntl.h" 11 + #endif
+151
linux-user/generic/fcntl.h
··· 1 + /* 2 + * This program is free software; you can redistribute it and/or modify 3 + * it under the terms of the GNU General Public License version 2 as 4 + * published by the Free Software Foundation, or (at your option) any 5 + * later version. See the COPYING file in the top-level directory. 6 + */ 7 + 8 + #ifndef GENERIC_FCNTL_H 9 + #define GENERIC_FCNTL_H 10 + 11 + /* <asm-generic/fcntl.h> values follow. */ 12 + #define TARGET_O_ACCMODE 0003 13 + #define TARGET_O_RDONLY 00 14 + #define TARGET_O_WRONLY 01 15 + #define TARGET_O_RDWR 02 16 + #ifndef TARGET_O_CREAT 17 + #define TARGET_O_CREAT 0100 /* not fcntl */ 18 + #endif 19 + #ifndef TARGET_O_EXCL 20 + #define TARGET_O_EXCL 0200 /* not fcntl */ 21 + #endif 22 + #ifndef TARGET_O_NOCTTY 23 + #define TARGET_O_NOCTTY 0400 /* not fcntl */ 24 + #endif 25 + #ifndef TARGET_O_TRUNC 26 + #define TARGET_O_TRUNC 01000 /* not fcntl */ 27 + #endif 28 + #ifndef TARGET_O_APPEND 29 + #define TARGET_O_APPEND 02000 30 + #endif 31 + #ifndef TARGET_O_NONBLOCK 32 + #define TARGET_O_NONBLOCK 04000 33 + #endif 34 + #ifndef TARGET_O_DSYNC 35 + #define TARGET_O_DSYNC 010000 36 + #endif 37 + #ifndef TARGET_FASYNC 38 + #define TARGET_FASYNC 020000 /* fcntl, for BSD compatibility */ 39 + #endif 40 + #ifndef TARGET_O_DIRECT 41 + #define TARGET_O_DIRECT 040000 /* direct disk access hint */ 42 + #endif 43 + #ifndef TARGET_O_LARGEFILE 44 + #define TARGET_O_LARGEFILE 0100000 45 + #endif 46 + #ifndef TARGET_O_DIRECTORY 47 + #define TARGET_O_DIRECTORY 0200000 /* must be a directory */ 48 + #endif 49 + #ifndef TARGET_O_NOFOLLOW 50 + #define TARGET_O_NOFOLLOW 0400000 /* don't follow links */ 51 + #endif 52 + #ifndef TARGET_O_NOATIME 53 + #define TARGET_O_NOATIME 01000000 54 + #endif 55 + #ifndef TARGET_O_CLOEXEC 56 + #define TARGET_O_CLOEXEC 02000000 57 + #endif 58 + #ifndef TARGET___O_SYNC 59 + #define TARGET___O_SYNC 04000000 60 + #endif 61 + #ifndef TARGET_O_PATH 62 + #define TARGET_O_PATH 010000000 63 + #endif 64 + #ifndef TARGET___O_TMPFILE 65 + #define TARGET___O_TMPFILE 020000000 66 + #endif 67 + #ifndef TARGET_O_TMPFILE 68 + #define TARGET_O_TMPFILE (TARGET___O_TMPFILE | TARGET_O_DIRECTORY) 69 + #endif 70 + #ifndef TARGET_O_NDELAY 71 + #define TARGET_O_NDELAY TARGET_O_NONBLOCK 72 + #endif 73 + #ifndef TARGET_O_SYNC 74 + #define TARGET_O_SYNC (TARGET___O_SYNC | TARGET_O_DSYNC) 75 + #endif 76 + 77 + #define TARGET_F_DUPFD 0 /* dup */ 78 + #define TARGET_F_GETFD 1 /* get close_on_exec */ 79 + #define TARGET_F_SETFD 2 /* set/clear close_on_exec */ 80 + #define TARGET_F_GETFL 3 /* get file->f_flags */ 81 + #define TARGET_F_SETFL 4 /* set file->f_flags */ 82 + #ifndef TARGET_F_GETLK 83 + #define TARGET_F_GETLK 5 84 + #define TARGET_F_SETLK 6 85 + #define TARGET_F_SETLKW 7 86 + #endif 87 + #ifndef TARGET_F_SETOWN 88 + #define TARGET_F_SETOWN 8 /* for sockets. */ 89 + #define TARGET_F_GETOWN 9 /* for sockets. */ 90 + #endif 91 + #ifndef TARGET_F_SETSIG 92 + #define TARGET_F_SETSIG 10 /* for sockets. */ 93 + #define TARGET_F_GETSIG 11 /* for sockets. */ 94 + #endif 95 + 96 + #ifndef TARGET_F_GETLK64 97 + #define TARGET_F_GETLK64 12 /* using 'struct flock64' */ 98 + #define TARGET_F_SETLK64 13 99 + #define TARGET_F_SETLKW64 14 100 + #endif 101 + 102 + #ifndef TARGET_F_SETOWN_EX 103 + #define TARGET_F_SETOWN_EX 15 104 + #define TARGET_F_GETOWN_EX 16 105 + #endif 106 + 107 + struct target_f_owner_ex { 108 + int type; /* Owner type of ID. */ 109 + int pid; /* ID of owner. */ 110 + }; 111 + 112 + #ifndef TARGET_F_RDLCK 113 + #define TARGET_F_RDLCK 0 114 + #define TARGET_F_WRLCK 1 115 + #define TARGET_F_UNLCK 2 116 + #endif 117 + 118 + #ifndef TARGET_F_EXLCK 119 + #define TARGET_F_EXLCK 4 120 + #define TARGET_F_SHLCK 8 121 + #endif 122 + 123 + #ifndef TARGET_ARCH_FLOCK_PAD 124 + #define TARGET_ARCH_FLOCK_PAD 125 + #endif 126 + 127 + struct target_flock { 128 + short l_type; 129 + short l_whence; 130 + abi_long l_start; 131 + abi_long l_len; 132 + #if defined(TARGET_MIPS) 133 + abi_long l_sysid; 134 + #endif 135 + int l_pid; 136 + TARGET_ARCH_FLOCK_PAD 137 + }; 138 + 139 + #ifndef TARGET_ARCH_FLOCK64_PAD 140 + #define TARGET_ARCH_FLOCK64_PAD 141 + #endif 142 + 143 + struct target_flock64 { 144 + abi_short l_type; 145 + abi_short l_whence; 146 + abi_llong l_start; 147 + abi_llong l_len; 148 + abi_int l_pid; 149 + TARGET_ARCH_FLOCK64_PAD 150 + }; 151 + #endif
+11
linux-user/hppa/target_fcntl.h
··· 1 + /* 2 + * This program is free software; you can redistribute it and/or modify 3 + * it under the terms of the GNU General Public License version 2 as 4 + * published by the Free Software Foundation, or (at your option) any 5 + * later version. See the COPYING file in the top-level directory. 6 + */ 7 + 8 + #ifndef HPPA_TARGET_FCNTL_H 9 + #define HPPA_TARGET_FCNTL_H 10 + #include "../generic/fcntl.h" 11 + #endif
+11
linux-user/i386/target_fcntl.h
··· 1 + /* 2 + * This program is free software; you can redistribute it and/or modify 3 + * it under the terms of the GNU General Public License version 2 as 4 + * published by the Free Software Foundation, or (at your option) any 5 + * later version. See the COPYING file in the top-level directory. 6 + */ 7 + 8 + #ifndef I386_TARGET_FCNTL_H 9 + #define I386_TARGET_FCNTL_H 10 + #include "../generic/fcntl.h" 11 + #endif
+11
linux-user/m68k/target_fcntl.h
··· 1 + /* 2 + * This program is free software; you can redistribute it and/or modify 3 + * it under the terms of the GNU General Public License version 2 as 4 + * published by the Free Software Foundation, or (at your option) any 5 + * later version. See the COPYING file in the top-level directory. 6 + */ 7 + 8 + #ifndef M68K_TARGET_FCNTL_H 9 + #define M68K_TARGET_FCNTL_H 10 + #include "../generic/fcntl.h" 11 + #endif
+11
linux-user/microblaze/target_fcntl.h
··· 1 + /* 2 + * This program is free software; you can redistribute it and/or modify 3 + * it under the terms of the GNU General Public License version 2 as 4 + * published by the Free Software Foundation, or (at your option) any 5 + * later version. See the COPYING file in the top-level directory. 6 + */ 7 + 8 + #ifndef MICROBLAZE_TARGET_FCNTL_H 9 + #define MICROBLAZE_TARGET_FCNTL_H 10 + #include "../generic/fcntl.h" 11 + #endif
+11
linux-user/mips/target_fcntl.h
··· 1 + /* 2 + * This program is free software; you can redistribute it and/or modify 3 + * it under the terms of the GNU General Public License version 2 as 4 + * published by the Free Software Foundation, or (at your option) any 5 + * later version. See the COPYING file in the top-level directory. 6 + */ 7 + 8 + #ifndef MIPS_TARGET_FCNTL_H 9 + #define MIPS_TARGET_FCNTL_H 10 + #include "../generic/fcntl.h" 11 + #endif
+1
linux-user/mips64/target_fcntl.h
··· 1 + #include "../mips/target_fcntl.h"
+11
linux-user/nios2/target_fcntl.h
··· 1 + /* 2 + * This program is free software; you can redistribute it and/or modify 3 + * it under the terms of the GNU General Public License version 2 as 4 + * published by the Free Software Foundation, or (at your option) any 5 + * later version. See the COPYING file in the top-level directory. 6 + */ 7 + 8 + #ifndef NIOS2_TARGET_FCNTL_H 9 + #define NIOS2_TARGET_FCNTL_H 10 + #include "../generic/fcntl.h" 11 + #endif
+11
linux-user/openrisc/target_fcntl.h
··· 1 + /* 2 + * This program is free software; you can redistribute it and/or modify 3 + * it under the terms of the GNU General Public License version 2 as 4 + * published by the Free Software Foundation, or (at your option) any 5 + * later version. See the COPYING file in the top-level directory. 6 + */ 7 + 8 + #ifndef OPENRISC_TARGET_FCNTL_H 9 + #define OPENRISC_TARGET_FCNTL_H 10 + #include "../generic/fcntl.h" 11 + #endif
+11
linux-user/ppc/target_fcntl.h
··· 1 + /* 2 + * This program is free software; you can redistribute it and/or modify 3 + * it under the terms of the GNU General Public License version 2 as 4 + * published by the Free Software Foundation, or (at your option) any 5 + * later version. See the COPYING file in the top-level directory. 6 + */ 7 + 8 + #ifndef PPC_TARGET_FCNTL_H 9 + #define PPC_TARGET_FCNTL_H 10 + #include "../generic/fcntl.h" 11 + #endif
+11
linux-user/riscv/target_fcntl.h
··· 1 + /* 2 + * This program is free software; you can redistribute it and/or modify 3 + * it under the terms of the GNU General Public License version 2 as 4 + * published by the Free Software Foundation, or (at your option) any 5 + * later version. See the COPYING file in the top-level directory. 6 + */ 7 + 8 + #ifndef RISCV_TARGET_FCNTL_H 9 + #define RISCV_TARGET_FCNTL_H 10 + #include "../generic/fcntl.h" 11 + #endif
+11
linux-user/s390x/target_fcntl.h
··· 1 + /* 2 + * This program is free software; you can redistribute it and/or modify 3 + * it under the terms of the GNU General Public License version 2 as 4 + * published by the Free Software Foundation, or (at your option) any 5 + * later version. See the COPYING file in the top-level directory. 6 + */ 7 + 8 + #ifndef S390X_TARGET_FCNTL_H 9 + #define S390X_TARGET_FCNTL_H 10 + #include "../generic/fcntl.h" 11 + #endif
+11
linux-user/sh4/target_fcntl.h
··· 1 + /* 2 + * This program is free software; you can redistribute it and/or modify 3 + * it under the terms of the GNU General Public License version 2 as 4 + * published by the Free Software Foundation, or (at your option) any 5 + * later version. See the COPYING file in the top-level directory. 6 + */ 7 + 8 + #ifndef SH4_TARGET_FCNTL_H 9 + #define SH4_TARGET_FCNTL_H 10 + #include "../generic/fcntl.h" 11 + #endif
+11
linux-user/sparc/target_fcntl.h
··· 1 + /* 2 + * This program is free software; you can redistribute it and/or modify 3 + * it under the terms of the GNU General Public License version 2 as 4 + * published by the Free Software Foundation, or (at your option) any 5 + * later version. See the COPYING file in the top-level directory. 6 + */ 7 + 8 + #ifndef SPARC_TARGET_FCNTL_H 9 + #define SPARC_TARGET_FCNTL_H 10 + #include "../generic/fcntl.h" 11 + #endif
+1
linux-user/sparc64/target_fcntl.h
··· 1 + #include "../sparc/target_fcntl.h"
+1 -128
linux-user/syscall_defs.h
··· 2407 2407 }; 2408 2408 #endif 2409 2409 2410 - 2411 - #define TARGET_F_DUPFD 0 /* dup */ 2412 - #define TARGET_F_GETFD 1 /* get close_on_exec */ 2413 - #define TARGET_F_SETFD 2 /* set/clear close_on_exec */ 2414 - #define TARGET_F_GETFL 3 /* get file->f_flags */ 2415 - #define TARGET_F_SETFL 4 /* set file->f_flags */ 2416 - 2417 2410 #if defined(TARGET_ALPHA) 2418 2411 #define TARGET_F_GETLK 7 2419 2412 #define TARGET_F_SETLK 8 ··· 2450 2443 #define TARGET_F_GETLK 7 2451 2444 #define TARGET_F_SETLK 8 2452 2445 #define TARGET_F_SETLKW 9 2453 - #else 2454 - #define TARGET_F_GETLK 5 2455 - #define TARGET_F_SETLK 6 2456 - #define TARGET_F_SETLKW 7 2457 - #define TARGET_F_SETOWN 8 /* for sockets. */ 2458 - #define TARGET_F_GETOWN 9 /* for sockets. */ 2459 2446 #endif 2460 - #define TARGET_F_SETOWN_EX 15 2461 - #define TARGET_F_GETOWN_EX 16 2462 - 2463 - #ifndef TARGET_F_RDLCK 2464 - #define TARGET_F_RDLCK 0 2465 - #define TARGET_F_WRLCK 1 2466 - #define TARGET_F_UNLCK 2 2467 - #endif 2468 - 2469 - #ifndef TARGET_F_EXLCK 2470 - #define TARGET_F_EXLCK 4 2471 - #define TARGET_F_SHLCK 8 2472 - #endif 2473 - 2474 2447 2475 2448 #if defined(TARGET_HPPA) 2476 2449 #define TARGET_F_SETSIG 13 /* for sockets. */ 2477 2450 #define TARGET_F_GETSIG 14 /* for sockets. */ 2478 - #else 2479 - #define TARGET_F_SETSIG 10 /* for sockets. */ 2480 - #define TARGET_F_GETSIG 11 /* for sockets. */ 2481 2451 #endif 2482 2452 2483 2453 #if defined(TARGET_MIPS) ··· 2488 2458 #define TARGET_F_GETLK64 8 /* using 'struct flock64' */ 2489 2459 #define TARGET_F_SETLK64 9 2490 2460 #define TARGET_F_SETLKW64 10 2491 - #else 2492 - #define TARGET_F_GETLK64 12 /* using 'struct flock64' */ 2493 - #define TARGET_F_SETLK64 13 2494 - #define TARGET_F_SETLKW64 14 2495 2461 #endif 2496 2462 2497 2463 #define TARGET_F_LINUX_SPECIFIC_BASE 1024 ··· 2577 2543 #define TARGET___O_TMPFILE 0x2000000 2578 2544 #endif 2579 2545 2580 - /* <asm-generic/fcntl.h> values follow. */ 2581 - #define TARGET_O_ACCMODE 0003 2582 - #define TARGET_O_RDONLY 00 2583 - #define TARGET_O_WRONLY 01 2584 - #define TARGET_O_RDWR 02 2585 - #ifndef TARGET_O_CREAT 2586 - #define TARGET_O_CREAT 0100 /* not fcntl */ 2587 - #endif 2588 - #ifndef TARGET_O_EXCL 2589 - #define TARGET_O_EXCL 0200 /* not fcntl */ 2590 - #endif 2591 - #ifndef TARGET_O_NOCTTY 2592 - #define TARGET_O_NOCTTY 0400 /* not fcntl */ 2593 - #endif 2594 - #ifndef TARGET_O_TRUNC 2595 - #define TARGET_O_TRUNC 01000 /* not fcntl */ 2596 - #endif 2597 - #ifndef TARGET_O_APPEND 2598 - #define TARGET_O_APPEND 02000 2599 - #endif 2600 - #ifndef TARGET_O_NONBLOCK 2601 - #define TARGET_O_NONBLOCK 04000 2602 - #endif 2603 - #ifndef TARGET_O_DSYNC 2604 - #define TARGET_O_DSYNC 010000 2605 - #endif 2606 - #ifndef TARGET_FASYNC 2607 - #define TARGET_FASYNC 020000 /* fcntl, for BSD compatibility */ 2608 - #endif 2609 - #ifndef TARGET_O_DIRECT 2610 - #define TARGET_O_DIRECT 040000 /* direct disk access hint */ 2611 - #endif 2612 - #ifndef TARGET_O_LARGEFILE 2613 - #define TARGET_O_LARGEFILE 0100000 2614 - #endif 2615 - #ifndef TARGET_O_DIRECTORY 2616 - #define TARGET_O_DIRECTORY 0200000 /* must be a directory */ 2617 - #endif 2618 - #ifndef TARGET_O_NOFOLLOW 2619 - #define TARGET_O_NOFOLLOW 0400000 /* don't follow links */ 2620 - #endif 2621 - #ifndef TARGET_O_NOATIME 2622 - #define TARGET_O_NOATIME 01000000 2623 - #endif 2624 - #ifndef TARGET_O_CLOEXEC 2625 - #define TARGET_O_CLOEXEC 02000000 2626 - #endif 2627 - #ifndef TARGET___O_SYNC 2628 - #define TARGET___O_SYNC 04000000 2629 - #endif 2630 - #ifndef TARGET_O_PATH 2631 - #define TARGET_O_PATH 010000000 2632 - #endif 2633 - #ifndef TARGET___O_TMPFILE 2634 - #define TARGET___O_TMPFILE 020000000 2635 - #endif 2636 - #ifndef TARGET_O_TMPFILE 2637 - #define TARGET_O_TMPFILE (TARGET___O_TMPFILE | TARGET_O_DIRECTORY) 2638 - #endif 2639 - #ifndef TARGET_O_NDELAY 2640 - #define TARGET_O_NDELAY TARGET_O_NONBLOCK 2641 - #endif 2642 - #ifndef TARGET_O_SYNC 2643 - #define TARGET_O_SYNC (TARGET___O_SYNC | TARGET_O_DSYNC) 2644 - #endif 2645 - 2646 2546 #if defined(TARGET_SPARC) 2647 2547 #define TARGET_ARCH_FLOCK_PAD abi_short __unused; 2648 2548 #define TARGET_ARCH_FLOCK64_PAD abi_short __unused; 2649 2549 #elif defined(TARGET_MIPS) 2650 2550 #define TARGET_ARCH_FLOCK_PAD abi_long pad[4]; 2651 2551 #define TARGET_ARCH_FLOCK64_PAD 2652 - #else 2653 - #define TARGET_ARCH_FLOCK_PAD 2654 - #define TARGET_ARCH_FLOCK64_PAD 2655 2552 #endif 2656 2553 2657 - struct target_flock { 2658 - short l_type; 2659 - short l_whence; 2660 - abi_long l_start; 2661 - abi_long l_len; 2662 - #if defined(TARGET_MIPS) 2663 - abi_long l_sysid; 2664 - #endif 2665 - int l_pid; 2666 - TARGET_ARCH_FLOCK_PAD 2667 - }; 2668 - 2669 - struct target_flock64 { 2670 - abi_short l_type; 2671 - abi_short l_whence; 2672 - abi_llong l_start; 2673 - abi_llong l_len; 2674 - abi_int l_pid; 2675 - TARGET_ARCH_FLOCK64_PAD 2676 - }; 2677 - 2678 - struct target_f_owner_ex { 2679 - int type; /* Owner type of ID. */ 2680 - int pid; /* ID of owner. */ 2681 - }; 2554 + #include "target_fcntl.h" 2682 2555 2683 2556 /* soundcard defines */ 2684 2557 /* XXX: convert them all to arch independent entries */
+11
linux-user/tilegx/target_fcntl.h
··· 1 + /* 2 + * This program is free software; you can redistribute it and/or modify 3 + * it under the terms of the GNU General Public License version 2 as 4 + * published by the Free Software Foundation, or (at your option) any 5 + * later version. See the COPYING file in the top-level directory. 6 + */ 7 + 8 + #ifndef TILEGX_TARGET_FCNTL_H 9 + #define TILEGX_TARGET_FCNTL_H 10 + #include "../generic/fcntl.h" 11 + #endif
+11
linux-user/x86_64/target_fcntl.h
··· 1 + /* 2 + * This program is free software; you can redistribute it and/or modify 3 + * it under the terms of the GNU General Public License version 2 as 4 + * published by the Free Software Foundation, or (at your option) any 5 + * later version. See the COPYING file in the top-level directory. 6 + */ 7 + 8 + #ifndef X86_64_TARGET_FCNTL_H 9 + #define X86_64_TARGET_FCNTL_H 10 + #include "../generic/fcntl.h" 11 + #endif
+11
linux-user/xtensa/target_fcntl.h
··· 1 + /* 2 + * This program is free software; you can redistribute it and/or modify 3 + * it under the terms of the GNU General Public License version 2 as 4 + * published by the Free Software Foundation, or (at your option) any 5 + * later version. See the COPYING file in the top-level directory. 6 + */ 7 + 8 + #ifndef XTENSA_TARGET_FCNTL_H 9 + #define XTENSA_TARGET_FCNTL_H 10 + #include "../generic/fcntl.h" 11 + #endif