Print this page
10908 Simplify SMAP relocations with krtld

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/sys/kobj.h
          +++ new/usr/src/uts/common/sys/kobj.h
↓ open down ↓ 16 lines elided ↑ open up ↑
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  /*
  22   22   * Copyright 2007 Sun Microsystems, Inc.  All rights reserved.
  23   23   * Use is subject to license terms.
  24   24   *
  25   25   * Copyright 2017 RackTop Systems.
  26   26   */
       27 +/*
       28 + * Copyright (c) 2017 Joyent, Inc.
       29 + */
  27   30  
  28   31  #ifndef _SYS_KOBJ_H
  29   32  #define _SYS_KOBJ_H
  30   33  
  31   34  #include <sys/modctl.h>
  32   35  #include <sys/elf.h>
  33   36  #include <sys/machelf.h>
  34   37  #include <sys/vmem.h>
  35   38  #include <sys/sdt.h>
  36   39  #include <sys/bootstat.h>
↓ open down ↓ 3 lines elided ↑ open up ↑
  40   43  #endif
  41   44  
  42   45  /*
  43   46   * List of modules maintained by kobj.c
  44   47   */
  45   48  struct module_list {
  46   49          struct module_list *next;
  47   50          struct module *mp;
  48   51  };
  49   52  
       53 +typedef struct hotinline_desc {
       54 +        char    *hid_symname;           /* symbol name */
       55 +        uintptr_t hid_instr_offset;     /* offset of call in text */
       56 +        struct hotinline_desc *hid_next;        /* next hotinline */
       57 +} hotinline_desc_t;
       58 +
  50   59  typedef unsigned short  symid_t;                /* symbol table index */
  51   60  typedef unsigned char   *reloc_dest_t;
  52   61  
  53   62  typedef void    module_mach;
  54   63  
  55   64  struct module {
  56   65          int total_allocated;
  57   66  
  58   67          Ehdr hdr;
  59   68          char *shdrs;
↓ open down ↓ 32 lines elided ↑ open up ↑
  92  101          module_mach * machdata;
  93  102          char *ctfdata;
  94  103          size_t ctfsize;
  95  104  
  96  105          char *fbt_tab;
  97  106          size_t fbt_size;
  98  107          size_t fbt_nentries;
  99  108          caddr_t textwin;
 100  109          caddr_t textwin_base;
 101  110  
      111 +        hotinline_desc_t *hi_calls;
      112 +
 102  113          sdt_probedesc_t *sdt_probes;
 103  114          size_t sdt_nprobes;
 104  115          char *sdt_tab;
 105  116          size_t sdt_size;
 106  117  
 107  118          char *sigdata;
 108  119          size_t sigsize;
 109  120  };
 110  121  
 111  122  struct kobj_mem {
↓ open down ↓ 68 lines elided ↑ open up ↑
 180  191  extern void kobj_close(intptr_t);
 181  192  extern void *kobj_alloc(size_t, int);
 182  193  extern void *kobj_zalloc(size_t, int);
 183  194  extern void kobj_free(void *, size_t);
 184  195  extern struct _buf *kobj_open_file(char *);
 185  196  extern void kobj_close_file(struct _buf *);
 186  197  extern int kobj_read_file(struct _buf *, char *, unsigned, unsigned);
 187  198  extern int kobj_get_filesize(struct _buf *, uint64_t *size);
 188  199  extern uintptr_t kobj_getelfsym(char *, void *, int *);
 189  200  extern void kobj_set_ctf(struct module *, caddr_t data, size_t size);
      201 +extern void do_hotinlines(struct module *);
 190  202  
 191  203  extern int kobj_filbuf(struct _buf *);
 192  204  extern void kobj_sync(void);
 193  205  #if defined(__i386) || defined(__sparc) || defined(__amd64)
 194  206  extern void kobj_vmem_init(vmem_t **, vmem_t **);
 195  207  #else
 196  208  #error "ISA not supported"
 197  209  #endif
 198  210  extern caddr_t kobj_text_alloc(vmem_t *, size_t);
 199  211  extern caddr_t kobj_texthole_alloc(caddr_t, size_t);
↓ open down ↓ 12 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX