Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3c37026d authored by Ralf Baechle's avatar Ralf Baechle
Browse files

NPTL, round one.

parent 38551576
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -95,6 +95,7 @@ void output_thread_info_defines(void)
	offset("#define TI_PRE_COUNT       ", struct thread_info, preempt_count);
	offset("#define TI_ADDR_LIMIT      ", struct thread_info, addr_limit);
	offset("#define TI_RESTART_BLOCK   ", struct thread_info, restart_block);
	offset("#define TI_TP_VALUE        ", struct thread_info, tp_value);
	constant("#define _THREAD_SIZE_ORDER ", THREAD_SIZE_ORDER);
	constant("#define _THREAD_SIZE       ", THREAD_SIZE);
	constant("#define _THREAD_MASK       ", THREAD_MASK);
+27 −0
Original line number Diff line number Diff line
@@ -1468,3 +1468,30 @@ sysn32_rt_sigtimedwait(const sigset_t __user *uthese,
	}
	return sys_rt_sigtimedwait(uthese, uinfo, uts, sigsetsize);
}

save_static_function(sys32_clone);
__attribute_used__ noinline static int
_sys32_clone(nabi_no_regargs struct pt_regs regs)
{
	unsigned long clone_flags;
	unsigned long newsp;
	int __user *parent_tidptr, *child_tidptr;

	clone_flags = regs.regs[4];
	newsp = regs.regs[5];
	if (!newsp)
		newsp = regs.regs[29];
	parent_tidptr = (int *) regs.regs[6];

	/* Use __dummy4 instead of getting it off the stack, so that
	   syscall() works.  */
	child_tidptr = (int __user *) __dummy4;
	return do_fork(clone_flags, newsp, &regs, 0,
	               parent_tidptr, child_tidptr);
}

extern asmlinkage void sys_set_thread_area(u32 addr);
asmlinkage void sys32_set_thread_area(u32 addr)
{
	sys_set_thread_area(AA(addr));
}
+4 −0
Original line number Diff line number Diff line
@@ -89,6 +89,7 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long usp,
	struct thread_info *ti = p->thread_info;
	struct pt_regs *childregs;
	long childksp;
	p->set_child_tid = p->clear_child_tid = NULL;

	childksp = (unsigned long)ti + THREAD_SIZE - 32;

@@ -134,6 +135,9 @@ int copy_thread(int nr, unsigned long clone_flags, unsigned long usp,
	childregs->cp0_status &= ~(ST0_CU2|ST0_CU1);
	clear_tsk_thread_flag(p, TIF_USEDFPU);

	if (clone_flags & CLONE_SETTLS)
		ti->tp_value = regs->regs[7];

	return 0;
}

+5 −0
Original line number Diff line number Diff line
@@ -289,6 +289,11 @@ asmlinkage int sys_ptrace(long request, long pid, long addr, long data)
		ret = ptrace_detach(child, data);
		break;

	case PTRACE_GET_THREAD_AREA:
		ret = put_user(child->thread_info->tp_value,
				(unsigned long __user *) data);
		break;

	default:
		ret = ptrace_request(child, request, addr, data);
		break;
+5 −0
Original line number Diff line number Diff line
@@ -268,6 +268,11 @@ asmlinkage int sys32_ptrace(int request, int pid, int addr, int data)
		wake_up_process(child);
		break;

	case PTRACE_GET_THREAD_AREA:
		ret = put_user(child->thread_info->tp_value,
				(unsigned int __user *) (unsigned long) data);
		break;

	case PTRACE_DETACH: /* detach a process that was attached. */
		ret = ptrace_detach(child, data);
		break;
Loading