/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
*/
#include "thr_uberdata.h"
#include <procfs.h>
#include <ucontext.h>
#include <setjmp.h>
/*
* The stack needs to be 16-byte aligned with a 4-byte bias. See comment in
* lib/libc/i386/gen/makectxt.c.
*
* Note: If you change it, you need to change it in the following files as
* well:
*
* - lib/libc/i386/gen/makectxt.c
*/
void *
{
struct {
} frame;
/*
* Top-of-stack must be rounded down to STACK_ALIGN and
* there must be a minimum frame. Note: 'frame' is not a true
* make it look like _lwp_start called the thread start function
* with a 16-byte aligned stack pointer (the address of frame.arg
* is the address that muet be aligned on a 16-byte boundary).
*/
/*
* This will return NULL if the kernel cannot allocate
* a page for the top page of the stack. This will cause
* thr_create(), pthread_create() or pthread_attr_setstack()
* to fail, passing the problem up to the application.
*/
return (stack);
return (NULL);
}
int
{
static int initialized;
if (!initialized) {
/* do this once to load the segment registers */
(void) __getcontext(&uc);
initialized = 1;
}
/* clear the context and set the segment registers */
/*
* Yuck.
* Use unused kernel pointer field in ucontext
* to pass down self pointer and set %gs selector
* value so __lwp_create() can setup %gs atomically.
* Without this we would need to block all signals
* and directly call ___lwp_private() in _thrp_setup
* on the other side of __lwp_create().
*/
/*
* Setup the top stack frame.
* If this fails, pass the problem up to the application.
*/
return (ENOMEM);
/* fill in registers of interest */
return (0);
}
/*
* Machine-dependent startup code for a newly-created thread.
*/
void *
{
tls_setup();
/* signals have been deferred until now */
return (NULL); /* cancelled by pthread_create() */
}
void
{
}
void
{
} else {
}
}
void
{
}
}
int
{
else {
}
if (savemask) {
}
return (0);
}
void
smt_pause(void)
{
SMT_PAUSE();
}