17c478bd9Sstevel@tonic-gate /* 27c478bd9Sstevel@tonic-gate * CDDL HEADER START 37c478bd9Sstevel@tonic-gate * 47c478bd9Sstevel@tonic-gate * The contents of this file are subject to the terms of the 502ca3e02Srie * Common Development and Distribution License (the "License"). 602ca3e02Srie * You may not use this file except in compliance with the License. 77c478bd9Sstevel@tonic-gate * 87c478bd9Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 97c478bd9Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 107c478bd9Sstevel@tonic-gate * See the License for the specific language governing permissions 117c478bd9Sstevel@tonic-gate * and limitations under the License. 127c478bd9Sstevel@tonic-gate * 137c478bd9Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 147c478bd9Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 157c478bd9Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 167c478bd9Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 177c478bd9Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 187c478bd9Sstevel@tonic-gate * 197c478bd9Sstevel@tonic-gate * CDDL HEADER END 207c478bd9Sstevel@tonic-gate */ 21*20c1c355SRod Evans 227c478bd9Sstevel@tonic-gate /* 23*20c1c355SRod Evans * Copyright (c) 1996, 2010, Oracle and/or its affiliates. All rights reserved. 247c478bd9Sstevel@tonic-gate */ 257c478bd9Sstevel@tonic-gate #ifndef WHO_DOT_H 267c478bd9Sstevel@tonic-gate #define WHO_DOT_H 277c478bd9Sstevel@tonic-gate 287c478bd9Sstevel@tonic-gate #include <link.h> 297c478bd9Sstevel@tonic-gate #include <sys/regset.h> 307c478bd9Sstevel@tonic-gate #include <sys/frame.h> 317c478bd9Sstevel@tonic-gate #include <sys/elf.h> 327c478bd9Sstevel@tonic-gate 337c478bd9Sstevel@tonic-gate #if defined(__sparcv9) 347c478bd9Sstevel@tonic-gate #define Elf_Ehdr Elf64_Ehdr 357c478bd9Sstevel@tonic-gate #define Elf_Phdr Elf64_Phdr 367c478bd9Sstevel@tonic-gate #define Elf_Shdr Elf64_Shdr 377c478bd9Sstevel@tonic-gate #define Elf_Sym Elf64_Sym 387c478bd9Sstevel@tonic-gate #define elf_getshdr elf64_getshdr 397c478bd9Sstevel@tonic-gate #else 407c478bd9Sstevel@tonic-gate #define Elf_Ehdr Elf32_Ehdr 417c478bd9Sstevel@tonic-gate #define Elf_Phdr Elf32_Phdr 427c478bd9Sstevel@tonic-gate #define Elf_Shdr Elf32_Shdr 437c478bd9Sstevel@tonic-gate #define Elf_Sym Elf32_Sym 447c478bd9Sstevel@tonic-gate #define elf_getshdr elf32_getshdr 457c478bd9Sstevel@tonic-gate #endif 467c478bd9Sstevel@tonic-gate 477c478bd9Sstevel@tonic-gate 487c478bd9Sstevel@tonic-gate typedef struct objinfo { 497c478bd9Sstevel@tonic-gate caddr_t o_lpc; /* low PC */ 507c478bd9Sstevel@tonic-gate caddr_t o_hpc; /* high PC */ 517c478bd9Sstevel@tonic-gate int o_fd; /* file descriptor */ 527c478bd9Sstevel@tonic-gate Elf *o_elf; /* Elf pointer */ 537c478bd9Sstevel@tonic-gate Elf_Sym *o_syms; /* symbol table */ 547c478bd9Sstevel@tonic-gate uint_t o_symcnt; /* # of symbols */ 557c478bd9Sstevel@tonic-gate const char *o_strs; /* symbol string table */ 567c478bd9Sstevel@tonic-gate Link_map *o_lmp; 577c478bd9Sstevel@tonic-gate uint_t o_flags; 587c478bd9Sstevel@tonic-gate struct objinfo *o_next; 597c478bd9Sstevel@tonic-gate } Objinfo; 607c478bd9Sstevel@tonic-gate 617c478bd9Sstevel@tonic-gate #define FLG_OB_NOSYMS 0x0001 /* no symbols available for obj */ 627c478bd9Sstevel@tonic-gate #define FLG_OB_FIXED 0x0002 /* fixed address object */ 637c478bd9Sstevel@tonic-gate 647c478bd9Sstevel@tonic-gate 6502ca3e02Srie #if defined(__sparc) 66e6cafd91Sseizo #if defined(__GNUC__) 67e6cafd91Sseizo #define FLUSHWIN() __asm__("ta 3"); 68e6cafd91Sseizo #else /* !__GNUC__ */ 697c478bd9Sstevel@tonic-gate #define FLUSHWIN() asm("ta 3"); 70e6cafd91Sseizo #endif 717c478bd9Sstevel@tonic-gate #endif 727c478bd9Sstevel@tonic-gate 7302ca3e02Srie #if defined(__x86) 747c478bd9Sstevel@tonic-gate #define FLUSHWIN() 757c478bd9Sstevel@tonic-gate #endif 767c478bd9Sstevel@tonic-gate 777c478bd9Sstevel@tonic-gate #ifndef STACK_BIAS 787c478bd9Sstevel@tonic-gate #define STACK_BIAS 0 797c478bd9Sstevel@tonic-gate #endif 807c478bd9Sstevel@tonic-gate 817c478bd9Sstevel@tonic-gate #endif /* WHO_DOT_H */ 82