xref: /onnv-gate/usr/src/lib/libc/sparc/genassym.c (revision 11913:283e725df792)
10Sstevel@tonic-gate /*
20Sstevel@tonic-gate  * CDDL HEADER START
30Sstevel@tonic-gate  *
40Sstevel@tonic-gate  * The contents of this file are subject to the terms of the
5*11913SRoger.Faulkner@Sun.COM  * Common Development and Distribution License (the "License").
6*11913SRoger.Faulkner@Sun.COM  * You may not use this file except in compliance with the License.
70Sstevel@tonic-gate  *
80Sstevel@tonic-gate  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
90Sstevel@tonic-gate  * or http://www.opensolaris.org/os/licensing.
100Sstevel@tonic-gate  * See the License for the specific language governing permissions
110Sstevel@tonic-gate  * and limitations under the License.
120Sstevel@tonic-gate  *
130Sstevel@tonic-gate  * When distributing Covered Code, include this CDDL HEADER in each
140Sstevel@tonic-gate  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
150Sstevel@tonic-gate  * If applicable, add the following below this CDDL HEADER, with the
160Sstevel@tonic-gate  * fields enclosed by brackets "[]" replaced with your own identifying
170Sstevel@tonic-gate  * information: Portions Copyright [yyyy] [name of copyright owner]
180Sstevel@tonic-gate  *
190Sstevel@tonic-gate  * CDDL HEADER END
200Sstevel@tonic-gate  */
21*11913SRoger.Faulkner@Sun.COM 
220Sstevel@tonic-gate /*
23*11913SRoger.Faulkner@Sun.COM  * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
240Sstevel@tonic-gate  * Use is subject to license terms.
250Sstevel@tonic-gate  */
260Sstevel@tonic-gate 
270Sstevel@tonic-gate #include <stdio.h>
280Sstevel@tonic-gate #include <stddef.h>
290Sstevel@tonic-gate #include <signal.h>
300Sstevel@tonic-gate #include <sys/synch.h>
310Sstevel@tonic-gate #include <sys/synch32.h>
320Sstevel@tonic-gate #include "thr_uberdata.h"
330Sstevel@tonic-gate 
340Sstevel@tonic-gate /*
350Sstevel@tonic-gate  * This file generates two values used by _lwp_mutex_unlock.s:
360Sstevel@tonic-gate  *	a) the byte offset (in lwp_mutex_t) of the word containing the lock byte
370Sstevel@tonic-gate  *	b) a mask to extract the waiter field from the word containing it
380Sstevel@tonic-gate  * These offsets do not change between 32-bit and 64-bit.
390Sstevel@tonic-gate  * Mutexes can be shared between 32-bit and 64-bit programs.
400Sstevel@tonic-gate  */
410Sstevel@tonic-gate 
420Sstevel@tonic-gate int
main(void)430Sstevel@tonic-gate main(void)
440Sstevel@tonic-gate {
450Sstevel@tonic-gate 	(void) printf("#define\tMUTEX_LOCK_WORD\t0x%p\n",
460Sstevel@tonic-gate 	    offsetof(lwp_mutex_t, mutex_lockword));
470Sstevel@tonic-gate 	(void) printf("#define\tWAITER_MASK\t0xff\n");
480Sstevel@tonic-gate 
490Sstevel@tonic-gate 	(void) printf("#define\tSIG_SETMASK\t0x%lx\n", SIG_SETMASK);
500Sstevel@tonic-gate 	(void) printf("#define\tMASKSET0\t0x%lx\n", MASKSET0);
510Sstevel@tonic-gate 	(void) printf("#define\tMASKSET1\t0x%lx\n", MASKSET1);
52*11913SRoger.Faulkner@Sun.COM 	(void) printf("#define\tMASKSET2\t0x%lx\n", MASKSET2);
53*11913SRoger.Faulkner@Sun.COM 	(void) printf("#define\tMASKSET3\t0x%lx\n", MASKSET3);
540Sstevel@tonic-gate 	(void) printf("#define\tSIGSEGV\t0x%lx\n", SIGSEGV);
550Sstevel@tonic-gate 
560Sstevel@tonic-gate 	return (0);
570Sstevel@tonic-gate }
58