machdep.c revision ae115bc77f6fcde83175c75b4206dc2e50747966
/*
* 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
*/
/*
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
#include "thr_uberdata.h"
#include <procfs.h>
#include <ucontext.h>
#include <setjmp.h>
int
{
static int initialized;
if (!initialized) {
/* do this once to load the segment registers */
(void) __getcontext_syscall(&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_setprivate() in _thr_setup
* on the other side of __lwp_create().
*/
/* top-of-stack must be rounded down to STACK_ALIGN */
/* set up top stack frame */
*--stack = 0;
*--stack = 0;
/* 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 */
}
void
{
}
void
{
} else {
}
}
void
{
}
}
int
{
else {
}
if (savemask) {
}
return (0);
}