rtld_machdep.h revision 133063
185004Sdfr/*- 285004Sdfr * Copyright (c) 1999, 2000 John D. Polstra. 385004Sdfr * All rights reserved. 485004Sdfr * 585004Sdfr * Redistribution and use in source and binary forms, with or without 685004Sdfr * modification, are permitted provided that the following conditions 785004Sdfr * are met: 885004Sdfr * 1. Redistributions of source code must retain the above copyright 985004Sdfr * notice, this list of conditions and the following disclaimer. 1085004Sdfr * 2. Redistributions in binary form must reproduce the above copyright 1185004Sdfr * notice, this list of conditions and the following disclaimer in the 1285004Sdfr * documentation and/or other materials provided with the distribution. 1385004Sdfr * 1485004Sdfr * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND 1585004Sdfr * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 1685004Sdfr * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE 1785004Sdfr * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE 1885004Sdfr * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 1985004Sdfr * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 2085004Sdfr * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 2185004Sdfr * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 2285004Sdfr * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 2385004Sdfr * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 2485004Sdfr * SUCH DAMAGE. 2585004Sdfr * 2685004Sdfr * $FreeBSD: head/libexec/rtld-elf/ia64/rtld_machdep.h 133063 2004-08-03 08:51:00Z dfr $ 2785004Sdfr */ 2885004Sdfr 2985004Sdfr#ifndef RTLD_MACHDEP_H 3085004Sdfr#define RTLD_MACHDEP_H 1 3185004Sdfr 32115396Skan#include <sys/types.h> 33115396Skan#include <machine/atomic.h> 34115396Skan 35115396Skan#define CACHE_LINE_SIZE 128 36115396Skan 3785004Sdfr/* 3885004Sdfr * Macros for cracking ia64 function pointers. 3985004Sdfr */ 4085004Sdfrstruct fptr { 4185004Sdfr Elf_Addr target; 4285004Sdfr Elf_Addr gp; 4385004Sdfr}; 4485004Sdfr 4585004Sdfr#define FPTR_TARGET(f) (((struct fptr *) (f))->target) 4685004Sdfr#define FPTR_GP(f) (((struct fptr *) (f))->gp) 4785004Sdfr 4885004Sdfr/* Return the address of the .dynamic section in the dynamic linker. */ 4985004Sdfr#define rtld_dynamic(obj) (&_DYNAMIC) 5085004Sdfr 5185004Sdfrstruct Struct_Obj_Entry; 5285004Sdfr 53107071StmmElf_Addr reloc_jmpslot(Elf_Addr *, Elf_Addr, const struct Struct_Obj_Entry *, 54107071Stmm const struct Struct_Obj_Entry *, const Elf_Rel *); 5585004Sdfrvoid *make_function_pointer(const Elf_Sym *, const struct Struct_Obj_Entry *); 5685677Spetervoid call_initfini_pointer(const struct Struct_Obj_Entry *, Elf_Addr); 5785004Sdfr 58133063Sdfr#define round(size, align) \ 59133063Sdfr (((size) + (align) - 1) & ~((align) - 1)) 60133063Sdfr#define calculate_first_tls_offset(size, align) \ 61133063Sdfr round(16, align) 62133063Sdfr#define calculate_tls_offset(prev_offset, prev_size, size, align) \ 63133063Sdfr round(prev_offset + prev_size, align) 64133063Sdfr#define calculate_tls_end(off, size) ((off) + (size)) 65133063Sdfr 66133063Sdfrextern void *__tls_get_addr(unsigned long module, unsigned long offset); 67133063Sdfr 6885004Sdfr#endif 69