Print this page
    
12220 loader multi-console shouldn't override bootenv.rc
    
      
        | Split | 
	Close | 
      
      | Expand all | 
      | Collapse all | 
    
    
          --- old/usr/src/uts/intel/sys/bootconf.h
          +++ new/usr/src/uts/intel/sys/bootconf.h
   1    1  /*
   2    2   * CDDL HEADER START
   3    3   *
   4    4   * The contents of this file are subject to the terms of the
   5    5   * Common Development and Distribution License (the "License").
   6    6   * You may not use this file except in compliance with the License.
   7    7   *
   8    8   * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
   9    9   * or http://www.opensolaris.org/os/licensing.
  10   10   * See the License for the specific language governing permissions
  11   11   * and limitations under the License.
  12   12   *
  13   13   * When distributing Covered Code, include this CDDL HEADER in each
  14   14   * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
  15   15   * If applicable, add the following below this CDDL HEADER, with the
  
    | 
      ↓ open down ↓ | 
    15 lines elided | 
    
      ↑ open up ↑ | 
  
  16   16   * fields enclosed by brackets "[]" replaced with your own identifying
  17   17   * information: Portions Copyright [yyyy] [name of copyright owner]
  18   18   *
  19   19   * CDDL HEADER END
  20   20   */
  21   21  
  22   22  /*
  23   23   * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
  24   24   * Use is subject to license terms.
  25   25   * Copyright 2016 Nexenta Systems, Inc.
  26      - * Copyright 2019, Joyent, Inc.
       26 + * Copyright 2020 Joyent, Inc.
  27   27   */
  28   28  
  29   29  #ifndef _SYS_BOOTCONF_H
  30   30  #define _SYS_BOOTCONF_H
  31   31  
  32   32  
  33   33  /*
  34   34   * Boot time configuration information objects
  35   35   */
  36   36  
  37   37  #include <sys/types.h>
  38   38  #include <sys/bootregs.h>               /* for struct bop_regs */
  39   39  #include <sys/bootstat.h>
  40   40  #include <sys/dirent.h>                 /* for struct dirent */
  41   41  #include <sys/memlist.h>
  42   42  #include <sys/obpdefs.h>
  43   43  #include <sys/varargs.h>
  44   44  #include <net/if.h>                     /* for IFNAMSIZ */
  45   45  
  46   46  #ifdef __cplusplus
  47   47  extern "C" {
  48   48  #endif
  49   49  
  50   50  #define BP_MAX_STRLEN   32
  51   51  
  52   52  /*
  53   53   * Boot property names
  54   54   */
  55   55  #define BP_CPU_APICID_ARRAY     "cpu_apicid_array"
  56   56  #define BP_LGRP_SLIT_ENABLE     "lgrp_slit_enable"
  57   57  #define BP_LGRP_SRAT_ENABLE     "lgrp_srat_enable"
  58   58  #define BP_LGRP_MSCT_ENABLE     "lgrp_msct_enable"
  59   59  #define BP_LGRP_TOPO_LEVELS     "lgrp_topo_levels"
  60   60  
  61   61  /*
  62   62   * masks to hand to bsys_alloc memory allocator
  63   63   * XXX  These names shouldn't really be srmmu derived.
  64   64   */
  65   65  #define BO_NO_ALIGN     0x00001000
  66   66  
  67   67  /* flags for BOP_EALLOC */
  68   68  #define BOPF_X86_ALLOC_CLIENT   0x001
  69   69  #define BOPF_X86_ALLOC_REAL     0x002
  70   70  #define BOPF_X86_ALLOC_IDMAP    0x003
  71   71  #define BOPF_X86_ALLOC_PHYS     0x004
  72   72  
  73   73  /* return values for the newer bootops */
  74   74  #define BOOT_SUCCESS    0
  75   75  #define BOOT_FAILURE    (-1)
  76   76  
  77   77  /* top of boot scratch memory: 15 MB; multiboot loads at 16 MB */
  78   78  #define MAGIC_PHYS      0xF00000
  79   79  
  80   80  /*
  81   81   *  We pass a ptr to the space that boot has been using
  82   82   *  for its memory lists.
  83   83   */
  84   84  struct bsys_mem {
  85   85          struct memlist  *physinstalled; /* amt of physmem installed */
  86   86          struct memlist  *rsvdmem;       /* amt of bios reserved mem */
  87   87          struct memlist  *physavail;     /* amt of physmem avail for use */
  88   88          struct memlist  *virtavail;     /* amt of virtmem avail for use */
  89   89          struct memlist  *pcimem;        /* amt of pcimem avail for use */
  90   90          uint_t          extent;         /* number of bytes in the space */
  91   91  };
  92   92  
  93   93  /*
  94   94   * Warning: Changing BO_VERSION blows compatibility between booters
  95   95   *          and older kernels.  If you want to change the struct bootops,
  96   96   *          please consider adding new stuff to the end and using the
  97   97   *          "bootops-extensions" mechanism described below.
  98   98   */
  99   99  #define BO_VERSION      10              /* bootops interface revision # */
 100  100  
 101  101  typedef struct bootops {
 102  102          /*
 103  103           * the ubiquitous version number
 104  104           */
 105  105          uint_t  bsys_version;
 106  106  
 107  107          /*
 108  108           * the area containing boot's memlists
 109  109           */
 110  110          struct  bsys_mem *boot_mem;
 111  111  
 112  112          /*
 113  113           * have boot allocate size bytes at virthint
 114  114           */
 115  115          caddr_t (*bsys_alloc)(struct bootops *, caddr_t virthint, size_t size,
 116  116                  int align);
 117  117  
 118  118          /*
 119  119           * free size bytes allocated at virt - put the
 120  120           * address range back onto the avail lists.
 121  121           */
 122  122          void    (*bsys_free)(struct bootops *, caddr_t virt, size_t size);
 123  123  
 124  124          /*
 125  125           * to find the size of the buffer to allocate
 126  126           */
 127  127          int     (*bsys_getproplen)(struct bootops *, const char *);
 128  128  
 129  129          /*
 130  130           * get the value associated with this name
 131  131           */
 132  132          int     (*bsys_getprop)(struct bootops *, const char *, void *);
 133  133  
 134  134          /*
 135  135           * get the name of the next property in succession
 136  136           * from the standalone
 137  137           */
 138  138          char    *(*bsys_nextprop)(struct bootops *, char *prevprop);
 139  139  
 140  140          /*
 141  141           * print formatted output
 142  142           */
 143  143          void    (*bsys_printf)(void *, const char *, ...);
 144  144  
 145  145          /*
 146  146           * Do a real mode interrupt
 147  147           */
 148  148          void    (*bsys_doint)(struct bootops *, int, struct bop_regs *);
 149  149  
 150  150          /*
 151  151           * Enhanced version of bsys_alloc().
 152  152           */
 153  153          caddr_t (*bsys_ealloc)(struct bootops *, caddr_t virthint, size_t size,
 154  154                  int align, int flags);
 155  155  
 156  156          /* end of bootops which exist if (bootops-extensions >= 1) */
 157  157  } bootops_t;
 158  158  
 159  159  #define BOP_GETVERSION(bop)             ((bop)->bsys_version)
 160  160  #define BOP_ALLOC(bop, virthint, size, align)   \
 161  161                                  ((bop)->bsys_alloc)(bop, virthint, size, align)
 162  162  #define BOP_FREE(bop, virt, size)       ((bop)->bsys_free)(bop, virt, size)
 163  163  #define BOP_GETPROPLEN(bop, name)       ((bop)->bsys_getproplen)(bop, name)
 164  164  #define BOP_GETPROP(bop, name, buf)     ((bop)->bsys_getprop)(bop, name, buf)
 165  165  #define BOP_NEXTPROP(bop, prev)         ((bop)->bsys_nextprop)(bop, prev)
 166  166  #define BOP_DOINT(bop, intnum, rp)      ((bop)->bsys_doint)(bop, intnum, rp)
 167  167  #define BOP_EALLOC(bop, virthint, size, align, flags)\
 168  168                  ((bop)->bsys_ealloc)(bop, virthint, size, align, flags)
 169  169  
 170  170  #define BOP_PUTSARG(bop, msg, arg)      ((bop)->bsys_printf)(bop, msg, arg)
 171  171  
 172  172  #if defined(_KERNEL) && !defined(_BOOT)
 173  173  
 174  174  /*
 175  175   * Boot configuration information
 176  176   */
 177  177  
 178  178  #define BO_MAXFSNAME    16
 179  179  #define BO_MAXOBJNAME   256
 180  180  
 181  181  struct bootobj {
 182  182          char    bo_fstype[BO_MAXFSNAME];        /* vfs type name (e.g. nfs) */
 183  183          char    bo_name[BO_MAXOBJNAME];         /* name of object */
 184  184          int     bo_flags;                       /* flags, see below */
 185  185          int     bo_size;                        /* number of blocks */
 186  186          struct vnode *bo_vp;                    /* vnode of object */
 187  187          char    bo_devname[BO_MAXOBJNAME];
 188  188          char    bo_ifname[BO_MAXOBJNAME];
 189  189          int     bo_ppa;
 190  190  };
 191  191  
 192  192  /*
 193  193   * flags
 194  194   */
 195  195  #define BO_VALID        0x01    /* all information in object is valid */
 196  196  #define BO_BUSY         0x02    /* object is busy */
 197  197  
 198  198  extern struct bootobj rootfs;
 199  199  extern struct bootobj swapfile;
 200  200  
 201  201  extern char obp_bootpath[BO_MAXOBJNAME];
 202  202  
 203  203  extern void *gfx_devinfo_list;
 204  204  
 205  205  extern dev_t getrootdev(void);
 206  206  extern void getfsname(char *, char *, size_t);
 207  207  extern int loadrootmodules(void);
 208  208  
 209  209  extern int strplumb(void);
 210  210  extern int strplumb_load(void);
 211  211  extern char *strplumb_get_netdev_path(void);
 212  212  
 213  213  extern void consconfig(void);
 214  214  extern void release_bootstrap(void);
 215  215  
 216  216  extern void param_check(void);
 217  217  extern int octet_to_hexascii(const void *, uint_t, char *, uint_t *);
 218  218  
 219  219  extern int dhcpinit(void);
 220  220  
 221  221  extern struct bootops *bootops;
 222  222  extern int netboot;
 223  223  extern int swaploaded;
 224  224  extern int modrootloaded;
 225  225  extern char kern_bootargs[];
 226  226  extern char kern_bootfile[];
 227  227  extern char *kobj_module_path;
 228  228  extern char *default_path;
 229  229  extern char *dhcack;
 230  230  extern int dhcacklen;
 231  231  extern char dhcifname[IFNAMSIZ];
 232  232  extern char *netdev_path;
 233  233  
 234  234  extern void bop_no_more_mem(void);
 235  235  
  
    | 
      ↓ open down ↓ | 
    199 lines elided | 
    
      ↑ open up ↑ | 
  
 236  236  /*PRINTFLIKE2*/
 237  237  extern void bop_printf(void *, const char *, ...)
 238  238      __KPRINTFLIKE(2);
 239  239  extern void vbop_printf(void *, const char *, va_list);
 240  240  
 241  241  /*PRINTFLIKE1*/
 242  242  extern void bop_panic(const char *, ...)
 243  243      __KPRINTFLIKE(1) __NORETURN;
 244  244  #pragma rarely_called(bop_panic)
 245  245  
 246      -extern void boot_prop_finish(void);
      246 +extern void read_bootenvrc(void);
 247  247  
 248  248  extern int bootprop_getval(const char *, u_longlong_t *);
 249  249  extern int bootprop_getstr(const char *, char *, size_t);
 250  250  
 251  251  /*
 252  252   * Back door to fakebop.c to get physical memory allocated.
 253  253   * 64 bit data types are fixed for 32 bit PAE use.
 254  254   */
 255  255  extern paddr_t do_bop_phys_alloc(uint64_t, uint64_t);
 256  256  
 257  257  extern int do_bsys_getproplen(bootops_t *, const char *);
 258  258  extern int do_bsys_getprop(bootops_t *, const char *, void *);
 259  259  extern int do_bsys_getproptype(bootops_t *, const char *);
 260  260  
 261  261  #endif /* _KERNEL && !_BOOT */
 262  262  
 263  263  #ifdef __cplusplus
 264  264  }
 265  265  #endif
 266  266  
 267  267  #endif  /* _SYS_BOOTCONF_H */
  
    | 
      ↓ open down ↓ | 
    11 lines elided | 
    
      ↑ open up ↑ | 
  
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX