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 <ucontext.h> 310Sstevel@tonic-gate #include <sys/stack.h> 320Sstevel@tonic-gate #include <sys/synch.h> 330Sstevel@tonic-gate #include <sys/synch32.h> 340Sstevel@tonic-gate #include "thr_uberdata.h" 350Sstevel@tonic-gate 360Sstevel@tonic-gate /* 370Sstevel@tonic-gate * This file generates two values used by _lwp_mutex_unlock.s: 380Sstevel@tonic-gate * a) the byte offset (in lwp_mutex_t) of the word containing the lock byte 390Sstevel@tonic-gate * b) a mask to extract the waiter field from the word containing it 400Sstevel@tonic-gate * It also generates offsets into the ucontext_t structure, needed by the 410Sstevel@tonic-gate * getcontext() function, which is written in assembly, as well as offsets 420Sstevel@tonic-gate * into the ulwp_t (thread) structure needed by certain assembler functions. 430Sstevel@tonic-gate */ 440Sstevel@tonic-gate 450Sstevel@tonic-gate int 460Sstevel@tonic-gate main(void) 470Sstevel@tonic-gate { 480Sstevel@tonic-gate (void) printf("#define\tMUTEX_LOCK_WORD\t0x%x\n", 490Sstevel@tonic-gate offsetof(lwp_mutex_t, mutex_lockword)); 500Sstevel@tonic-gate (void) printf("#define\tWAITER_MASK\t0x00ff0000\n"); 510Sstevel@tonic-gate 520Sstevel@tonic-gate (void) printf("#define\tSIG_SETMASK\t0x%x\n", SIG_SETMASK); 530Sstevel@tonic-gate (void) printf("#define\tMASKSET0\t0x%x\n", MASKSET0); 540Sstevel@tonic-gate (void) printf("#define\tMASKSET1\t0x%x\n", MASKSET1); 55*11913SRoger.Faulkner@Sun.COM (void) printf("#define\tMASKSET2\t0x%x\n", MASKSET2); 56*11913SRoger.Faulkner@Sun.COM (void) printf("#define\tMASKSET3\t0x%x\n", MASKSET3); 570Sstevel@tonic-gate (void) printf("#define\tSIGSEGV\t0x%x\n", SIGSEGV); 580Sstevel@tonic-gate 590Sstevel@tonic-gate (void) printf("#define\tEIP_OFF\t0x%x\n", EIP * 4); 600Sstevel@tonic-gate (void) printf("#define\tEAX_OFF\t0x%x\n", EAX * 4); 610Sstevel@tonic-gate (void) printf("#define\tUESP_OFF\t0x%x\n", UESP * 4); 620Sstevel@tonic-gate 630Sstevel@tonic-gate return (0); 640Sstevel@tonic-gate } 65