xref: /titanic_50/usr/src/lib/libc/sparc/genassym.c (revision 174bc6499d233e329ecd3d98a880a7b07df16bfa)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License (the "License").
6  * You may not use this file except in compliance with the License.
7  *
8  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9  * or http://www.opensolaris.org/os/licensing.
10  * See the License for the specific language governing permissions
11  * and limitations under the License.
12  *
13  * When distributing Covered Code, include this CDDL HEADER in each
14  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15  * If applicable, add the following below this CDDL HEADER, with the
16  * fields enclosed by brackets "[]" replaced with your own identifying
17  * information: Portions Copyright [yyyy] [name of copyright owner]
18  *
19  * CDDL HEADER END
20  */
21 
22 /*
23  * Copyright 2010 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #include <stdio.h>
28 #include <stddef.h>
29 #include <signal.h>
30 #include <sys/synch.h>
31 #include <sys/synch32.h>
32 #include "thr_uberdata.h"
33 
34 /*
35  * This file generates two values used by _lwp_mutex_unlock.s:
36  *	a) the byte offset (in lwp_mutex_t) of the word containing the lock byte
37  *	b) a mask to extract the waiter field from the word containing it
38  * These offsets do not change between 32-bit and 64-bit.
39  * Mutexes can be shared between 32-bit and 64-bit programs.
40  */
41 
42 int
43 main(void)
44 {
45 	(void) printf("#define\tMUTEX_LOCK_WORD\t0x%p\n",
46 	    offsetof(lwp_mutex_t, mutex_lockword));
47 	(void) printf("#define\tWAITER_MASK\t0xff\n");
48 
49 	(void) printf("#define\tSIG_SETMASK\t0x%lx\n", SIG_SETMASK);
50 	(void) printf("#define\tMASKSET0\t0x%lx\n", MASKSET0);
51 	(void) printf("#define\tMASKSET1\t0x%lx\n", MASKSET1);
52 	(void) printf("#define\tMASKSET2\t0x%lx\n", MASKSET2);
53 	(void) printf("#define\tMASKSET3\t0x%lx\n", MASKSET3);
54 	(void) printf("#define\tSIGSEGV\t0x%lx\n", SIGSEGV);
55 
56 	return (0);
57 }
58