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