Lines Matching full:info
74 static int child(struct shared_info *info) in child() argument
82 ret = wait_parent(&info->child_sync); in child()
90 CHILD_FAIL_IF(pkey1 < 0, &info->child_sync); in child()
96 CHILD_FAIL_IF(pkey2 < 0, &info->child_sync); in child()
99 CHILD_FAIL_IF(pkey3 < 0, &info->child_sync); in child()
101 info->amr1 |= 3ul << pkeyshift(pkey1); in child()
102 info->amr2 |= 3ul << pkeyshift(pkey2); in child()
103 info->amr3 |= info->amr2 | 3ul << pkeyshift(pkey3); in child()
106 info->expected_iamr |= 1ul << pkeyshift(pkey1); in child()
108 info->expected_iamr &= ~(1ul << pkeyshift(pkey1)); in child()
110 info->expected_iamr &= ~(1ul << pkeyshift(pkey2) | 1ul << pkeyshift(pkey3)); in child()
112 info->expected_uamor |= 3ul << pkeyshift(pkey1) | in child()
114 info->new_iamr |= 1ul << pkeyshift(pkey1) | 1ul << pkeyshift(pkey2); in child()
115 info->new_uamor |= 3ul << pkeyshift(pkey1); in child()
127 user_write, info->amr1, pkey1, pkey2, pkey3); in child()
129 mtspr(SPRN_AMR, info->amr1); in child()
132 ret = prod_parent(&info->child_sync); in child()
133 CHILD_FAIL_IF(ret, &info->child_sync); in child()
135 ret = wait_parent(&info->child_sync); in child()
143 CHILD_FAIL_IF(reg != info->amr2, &info->child_sync); in child()
148 ret = prod_parent(&info->child_sync); in child()
149 CHILD_FAIL_IF(ret, &info->child_sync); in child()
151 ret = wait_parent(&info->child_sync); in child()
159 CHILD_FAIL_IF(reg != info->amr2, &info->child_sync); in child()
165 ret = prod_parent(&info->child_sync); in child()
166 CHILD_FAIL_IF(ret, &info->child_sync); in child()
168 ret = wait_parent(&info->child_sync); in child()
176 CHILD_FAIL_IF(reg != info->amr2, &info->child_sync); in child()
180 ret = prod_parent(&info->child_sync); in child()
181 CHILD_FAIL_IF(ret, &info->child_sync); in child()
186 static int parent(struct shared_info *info, pid_t pid) in parent() argument
196 PARENT_SKIP_IF_UNSUPPORTED(ret, &info->child_sync); in parent()
197 PARENT_FAIL_IF(ret, &info->child_sync); in parent()
199 info->amr1 = info->amr2 = info->amr3 = regs[0]; in parent()
200 info->expected_iamr = info->new_iamr = regs[1]; in parent()
201 info->expected_uamor = info->new_uamor = regs[2]; in parent()
204 ret = prod_child(&info->child_sync); in parent()
205 PARENT_FAIL_IF(ret, &info->child_sync); in parent()
207 ret = wait_child(&info->child_sync); in parent()
213 PARENT_FAIL_IF(ret, &info->child_sync); in parent()
218 PARENT_FAIL_IF(regs[0] != info->amr1, &info->child_sync); in parent()
219 PARENT_FAIL_IF(regs[1] != info->expected_iamr, &info->child_sync); in parent()
220 PARENT_FAIL_IF(regs[2] != info->expected_uamor, &info->child_sync); in parent()
223 ret = ptrace_write_regs(pid, NT_PPC_PKEY, &info->amr2, 1); in parent()
224 PARENT_FAIL_IF(ret, &info->child_sync); in parent()
226 printf("%-30s AMR: %016lx\n", ptrace_write_running, info->amr2); in parent()
229 ret = prod_child(&info->child_sync); in parent()
230 PARENT_FAIL_IF(ret, &info->child_sync); in parent()
232 ret = wait_child(&info->child_sync); in parent()
237 ret = ptrace_write_regs(pid, NT_PPC_PKEY, &info->amr3, 1); in parent()
238 PARENT_FAIL_IF(ret, &info->child_sync); in parent()
240 printf("%-30s AMR: %016lx\n", ptrace_write_running, info->amr3); in parent()
243 ret = prod_child(&info->child_sync); in parent()
244 PARENT_FAIL_IF(ret, &info->child_sync); in parent()
246 ret = wait_child(&info->child_sync); in parent()
251 regs[0] = info->amr1; in parent()
252 regs[1] = info->new_iamr; in parent()
254 PARENT_FAIL_IF(!ret, &info->child_sync); in parent()
260 regs[2] = info->new_uamor; in parent()
262 PARENT_FAIL_IF(!ret, &info->child_sync); in parent()
269 PARENT_FAIL_IF(ret, &info->child_sync); in parent()
274 PARENT_FAIL_IF(regs[0] != info->amr2, &info->child_sync); in parent()
275 PARENT_FAIL_IF(regs[1] != info->expected_iamr, &info->child_sync); in parent()
276 PARENT_FAIL_IF(regs[2] != info->expected_uamor, &info->child_sync); in parent()
279 ret = prod_child(&info->child_sync); in parent()
280 PARENT_FAIL_IF(ret, &info->child_sync); in parent()
297 struct shared_info *info; in ptrace_pkey() local
302 shm_id = shmget(IPC_PRIVATE, sizeof(*info), 0777 | IPC_CREAT); in ptrace_pkey()
303 info = shmat(shm_id, NULL, 0); in ptrace_pkey()
305 ret = init_child_sync(&info->child_sync); in ptrace_pkey()
314 ret = child(info); in ptrace_pkey()
316 ret = parent(info, pid); in ptrace_pkey()
318 shmdt(info); in ptrace_pkey()
321 destroy_child_sync(&info->child_sync); in ptrace_pkey()