Commit b9d62433 authored by David S. Miller's avatar David S. Miller
Browse files
parents 062c84fc 415ddc3b
Loading
Loading
Loading
Loading
+1 −5
Original line number Diff line number Diff line
@@ -50,16 +50,12 @@ struct thread_struct {
	unsigned long   fsr;
	unsigned long   fpqdepth;
	struct fpq	fpqueue[16];
	unsigned long flags;
	mm_segment_t current_ds;
};

#define SPARC_FLAG_KTHREAD      0x1    /* task is a kernel thread */
#define SPARC_FLAG_UNALIGNED    0x2    /* is allowed to do unaligned accesses */

#define INIT_THREAD  { \
	.flags = SPARC_FLAG_KTHREAD, \
	.current_ds = KERNEL_DS, \
	.kregs = (struct pt_regs *)(init_stack+THREAD_SIZE)-1 \
}

/* Do necessary setup to start up a newly executed thread. */
+1 −0
Original line number Diff line number Diff line
@@ -118,6 +118,7 @@ struct thread_info {
	.task		=	&tsk,			\
	.current_ds	=	ASI_P,			\
	.preempt_count	=	INIT_PREEMPT_COUNT,	\
	.kregs		=	(struct pt_regs *)(init_stack+THREAD_SIZE)-1 \
}

/* how to get the thread information struct from C */
+1 −1
Original line number Diff line number Diff line
@@ -515,7 +515,7 @@ continue_boot:

		/* I want a kernel stack NOW! */
		set	init_thread_union, %g1
		set	(THREAD_SIZE - STACKFRAME_SZ), %g2
		set	(THREAD_SIZE - STACKFRAME_SZ - TRACEREG_SZ), %g2
		add	%g1, %g2, %sp
		mov	0, %fp			/* And for good luck */

+1 −1
Original line number Diff line number Diff line
@@ -706,7 +706,7 @@ tlb_fixup_done:
	wr	%g0, ASI_P, %asi
	mov	1, %g1
	sllx	%g1, THREAD_SHIFT, %g1
	sub	%g1, (STACKFRAME_SZ + STACK_BIAS), %g1
	sub	%g1, (STACKFRAME_SZ + STACK_BIAS + TRACEREG_SZ), %g1
	add	%g6, %g1, %sp

	/* Set per-cpu pointer initially to zero, this makes
+0 −12
Original line number Diff line number Diff line
@@ -216,16 +216,6 @@ void flush_thread(void)
		clear_thread_flag(TIF_USEDFPU);
#endif
	}

	/* This task is no longer a kernel thread. */
	if (current->thread.flags & SPARC_FLAG_KTHREAD) {
		current->thread.flags &= ~SPARC_FLAG_KTHREAD;

		/* We must fixup kregs as well. */
		/* XXX This was not fixed for ti for a while, worked. Unused? */
		current->thread.kregs = (struct pt_regs *)
		    (task_stack_page(current) + (THREAD_SIZE - TRACEREG_SZ));
	}
}

static inline struct sparc_stackf __user *
@@ -313,7 +303,6 @@ int copy_thread(unsigned long clone_flags, unsigned long sp, unsigned long arg,
		extern int nwindows;
		unsigned long psr;
		memset(new_stack, 0, STACKFRAME_SZ + TRACEREG_SZ);
		p->thread.flags |= SPARC_FLAG_KTHREAD;
		p->thread.current_ds = KERNEL_DS;
		ti->kpc = (((unsigned long) ret_from_kernel_thread) - 0x8);
		childregs->u_regs[UREG_G1] = sp; /* function */
@@ -325,7 +314,6 @@ int copy_thread(unsigned long clone_flags, unsigned long sp, unsigned long arg,
	}
	memcpy(new_stack, (char *)regs - STACKFRAME_SZ, STACKFRAME_SZ + TRACEREG_SZ);
	childregs->u_regs[UREG_FP] = sp;
	p->thread.flags &= ~SPARC_FLAG_KTHREAD;
	p->thread.current_ds = USER_DS;
	ti->kpc = (((unsigned long) ret_from_fork) - 0x8);
	ti->kpsr = current->thread.fork_kpsr | PSR_PIL;
Loading