Dmitry V. Levin | 85a364a | 2014-12-06 03:53:16 +0000 | [diff] [blame] | 1 | #include "defs.h" |
| 2 | |
| 3 | #include <sys/swap.h> |
| 4 | |
| 5 | #ifndef SWAP_FLAG_PREFER |
| 6 | # define SWAP_FLAG_PREFER 0x8000 |
| 7 | #endif |
| 8 | #ifndef SWAP_FLAG_DISCARD |
| 9 | # define SWAP_FLAG_DISCARD 0x10000 |
| 10 | #endif |
Dmitry V. Levin | 825b524 | 2014-12-13 01:34:47 +0000 | [diff] [blame] | 11 | #ifndef SWAP_FLAG_DISCARD_ONCE |
| 12 | # define SWAP_FLAG_DISCARD_ONCE 0x20000 |
| 13 | #endif |
| 14 | #ifndef SWAP_FLAG_DISCARD_PAGES |
| 15 | # define SWAP_FLAG_DISCARD_PAGES 0x40000 |
| 16 | #endif |
Dmitry V. Levin | 85a364a | 2014-12-06 03:53:16 +0000 | [diff] [blame] | 17 | |
| 18 | #include "xlat/swap_flags.h" |
| 19 | |
| 20 | int |
| 21 | sys_swapon(struct tcb *tcp) |
| 22 | { |
| 23 | if (entering(tcp)) { |
| 24 | int flags = tcp->u_arg[1]; |
| 25 | printpath(tcp, tcp->u_arg[0]); |
| 26 | tprints(", "); |
| 27 | printflags(swap_flags, flags & ~SWAP_FLAG_PRIO_MASK, |
| 28 | "SWAP_FLAG_???"); |
| 29 | if (flags & SWAP_FLAG_PREFER) |
| 30 | tprintf("|%d", flags & SWAP_FLAG_PRIO_MASK); |
| 31 | } |
| 32 | return 0; |
| 33 | } |