File tree 3 files changed +10
-47
lines changed
tools/testing/selftests/powerpc
3 files changed +10
-47
lines changed Original file line number Diff line number Diff line change 35
35
#define __NR_pkey_alloc 384
36
36
#define __NR_pkey_free 385
37
37
38
+ #ifndef NT_PPC_PKEY
39
+ #define NT_PPC_PKEY 0x110
40
+ #endif
41
+
38
42
#define PKEY_BITS_PER_PKEY 2
39
43
#define NR_PKEYS 32
40
44
#define PKEY_BITS_MASK ((1UL << PKEY_BITS_PER_PKEY) - 1)
41
45
46
+ #define AMR_BITS_PER_PKEY 2
47
+ #define PKEY_REG_BITS (sizeof(u64) * 8)
48
+ #define pkeyshift (pkey ) (PKEY_REG_BITS - ((pkey + 1) * AMR_BITS_PER_PKEY))
49
+
42
50
inline unsigned long pkeyreg_get (void )
43
51
{
44
52
return mfspr (SPRN_AMR );
Original file line number Diff line number Diff line change 16
16
#include <unistd.h>
17
17
#include "ptrace.h"
18
18
#include "child.h"
19
-
20
- #ifndef __NR_pkey_alloc
21
- #define __NR_pkey_alloc 384
22
- #endif
23
-
24
- #ifndef __NR_pkey_free
25
- #define __NR_pkey_free 385
26
- #endif
27
-
28
- #ifndef NT_PPC_PKEY
29
- #define NT_PPC_PKEY 0x110
30
- #endif
19
+ #include "pkeys.h"
31
20
32
21
#ifndef PKEY_DISABLE_EXECUTE
33
22
#define PKEY_DISABLE_EXECUTE 0x4
34
23
#endif
35
24
36
- #define AMR_BITS_PER_PKEY 2
37
- #define PKEY_REG_BITS (sizeof(u64) * 8)
38
- #define pkeyshift (pkey ) (PKEY_REG_BITS - ((pkey + 1) * AMR_BITS_PER_PKEY))
39
-
40
25
#define CORE_FILE_LIMIT (5 * 1024 * 1024) /* 5 MB should be enough */
41
26
42
27
static const char core_pattern_file [] = "/proc/sys/kernel/core_pattern" ;
@@ -61,16 +46,6 @@ struct shared_info {
61
46
time_t core_time ;
62
47
};
63
48
64
- static int sys_pkey_alloc (unsigned long flags , unsigned long init_access_rights )
65
- {
66
- return syscall (__NR_pkey_alloc , flags , init_access_rights );
67
- }
68
-
69
- static int sys_pkey_free (int pkey )
70
- {
71
- return syscall (__NR_pkey_free , pkey );
72
- }
73
-
74
49
static int increase_core_file_limit (void )
75
50
{
76
51
struct rlimit rlim ;
Original file line number Diff line number Diff line change 7
7
*/
8
8
#include "ptrace.h"
9
9
#include "child.h"
10
-
11
- #ifndef __NR_pkey_alloc
12
- #define __NR_pkey_alloc 384
13
- #endif
14
-
15
- #ifndef __NR_pkey_free
16
- #define __NR_pkey_free 385
17
- #endif
18
-
19
- #ifndef NT_PPC_PKEY
20
- #define NT_PPC_PKEY 0x110
21
- #endif
10
+ #include "pkeys.h"
22
11
23
12
#ifndef PKEY_DISABLE_EXECUTE
24
13
#define PKEY_DISABLE_EXECUTE 0x4
25
14
#endif
26
15
27
- #define AMR_BITS_PER_PKEY 2
28
- #define PKEY_REG_BITS (sizeof(u64) * 8)
29
- #define pkeyshift (pkey ) (PKEY_REG_BITS - ((pkey + 1) * AMR_BITS_PER_PKEY))
30
-
31
16
static const char user_read [] = "[User Read (Running)]" ;
32
17
static const char user_write [] = "[User Write (Running)]" ;
33
18
static const char ptrace_read_running [] = "[Ptrace Read (Running)]" ;
@@ -61,11 +46,6 @@ struct shared_info {
61
46
unsigned long invalid_uamor ;
62
47
};
63
48
64
- static int sys_pkey_alloc (unsigned long flags , unsigned long init_access_rights )
65
- {
66
- return syscall (__NR_pkey_alloc , flags , init_access_rights );
67
- }
68
-
69
49
static int child (struct shared_info * info )
70
50
{
71
51
unsigned long reg ;
You can’t perform that action at this time.
0 commit comments