File tree 3 files changed +10
-55
lines changed
tools/testing/selftests/powerpc
3 files changed +10
-55
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
31
-
32
- #ifndef PKEY_DISABLE_EXECUTE
33
- #define PKEY_DISABLE_EXECUTE 0x4
34
- #endif
35
-
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))
19
+ #include "pkeys.h"
39
20
40
21
#define CORE_FILE_LIMIT (5 * 1024 * 1024) /* 5 MB should be enough */
41
22
@@ -61,16 +42,6 @@ struct shared_info {
61
42
time_t core_time ;
62
43
};
63
44
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
45
static int increase_core_file_limit (void )
75
46
{
76
47
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
22
-
23
- #ifndef PKEY_DISABLE_EXECUTE
24
- #define PKEY_DISABLE_EXECUTE 0x4
25
- #endif
26
-
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))
10
+ #include "pkeys.h"
30
11
31
12
static const char user_read [] = "[User Read (Running)]" ;
32
13
static const char user_write [] = "[User Write (Running)]" ;
@@ -61,11 +42,6 @@ struct shared_info {
61
42
unsigned long invalid_uamor ;
62
43
};
63
44
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
45
static int child (struct shared_info * info )
70
46
{
71
47
unsigned long reg ;
You can’t perform that action at this time.
0 commit comments