Revision b2178704 linux-user/signal.c
b/linux-user/signal.c | ||
---|---|---|
3064 | 3064 |
uint32_t oldmask; |
3065 | 3065 |
}; |
3066 | 3066 |
|
3067 |
struct target_stack_t { |
|
3068 |
abi_ulong ss_sp; |
|
3069 |
int ss_flags; |
|
3070 |
unsigned int ss_size; |
|
3071 |
}; |
|
3072 |
|
|
3073 |
struct target_ucontext { |
|
3074 |
abi_ulong uc_flags; |
|
3075 |
abi_ulong uc_link; |
|
3076 |
struct target_stack_t uc_stack; |
|
3077 |
struct target_sigcontext sc; |
|
3078 |
uint32_t extramask[TARGET_NSIG_WORDS - 1]; |
|
3079 |
}; |
|
3080 |
|
|
3067 | 3081 |
/* Signal frames. */ |
3068 | 3082 |
struct target_signal_frame { |
3069 |
struct target_sigcontext sc;
|
|
3083 |
struct target_ucontext uc;
|
|
3070 | 3084 |
uint32_t extramask[TARGET_NSIG_WORDS - 1]; |
3071 | 3085 |
uint32_t tramp[2]; |
3072 | 3086 |
}; |
... | ... | |
3175 | 3189 |
goto badframe; |
3176 | 3190 |
|
3177 | 3191 |
/* Save the mask. */ |
3178 |
err |= __put_user(set->sig[0], &frame->sc.oldmask); |
|
3192 |
err |= __put_user(set->sig[0], &frame->uc.sc.oldmask);
|
|
3179 | 3193 |
if (err) |
3180 | 3194 |
goto badframe; |
3181 | 3195 |
|
... | ... | |
3184 | 3198 |
goto badframe; |
3185 | 3199 |
} |
3186 | 3200 |
|
3187 |
setup_sigcontext(&frame->sc, env); |
|
3201 |
setup_sigcontext(&frame->uc.sc, env);
|
|
3188 | 3202 |
|
3189 | 3203 |
/* Set up to return from userspace. If provided, use a stub |
3190 | 3204 |
already in userspace. */ |
... | ... | |
3214 | 3228 |
/* Signal handler args: */ |
3215 | 3229 |
env->regs[5] = sig; /* Arg 0: signum */ |
3216 | 3230 |
env->regs[6] = 0; |
3217 |
env->regs[7] = (unsigned long) &frame->sc; /* arg 1: sigcontext */
|
|
3231 |
env->regs[7] = (unsigned long) &frame->uc; /* arg 1: sigcontext */
|
|
3218 | 3232 |
|
3219 | 3233 |
/* Offset of 4 to handle microblaze rtid r14, 0 */ |
3220 | 3234 |
env->sregs[SR_PC] = (unsigned long)ka->_sa_handler; |
... | ... | |
3247 | 3261 |
goto badframe; |
3248 | 3262 |
|
3249 | 3263 |
/* Restore blocked signals */ |
3250 |
if (__get_user(target_set.sig[0], &frame->sc.oldmask)) |
|
3264 |
if (__get_user(target_set.sig[0], &frame->uc.sc.oldmask))
|
|
3251 | 3265 |
goto badframe; |
3252 | 3266 |
for(i = 1; i < TARGET_NSIG_WORDS; i++) { |
3253 | 3267 |
if (__get_user(target_set.sig[i], &frame->extramask[i - 1])) |
... | ... | |
3256 | 3270 |
target_to_host_sigset_internal(&set, &target_set); |
3257 | 3271 |
sigprocmask(SIG_SETMASK, &set, NULL); |
3258 | 3272 |
|
3259 |
restore_sigcontext(&frame->sc, env); |
|
3273 |
restore_sigcontext(&frame->uc.sc, env);
|
|
3260 | 3274 |
/* We got here through a sigreturn syscall, our path back is via an |
3261 | 3275 |
rtb insn so setup r14 for that. */ |
3262 | 3276 |
env->regs[14] = env->sregs[SR_PC]; |
Also available in: Unified diff