Print this page
fakebop: use a memlist to keep track of physical memory

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/arm/sys/bootconf.h
          +++ new/usr/src/uts/arm/sys/bootconf.h
↓ open down ↓ 3 lines elided ↑ open up ↑
   4    4   * You may only use this file in accordance with the terms of version
   5    5   * 1.0 of the CDDL.
   6    6   *
   7    7   * A full copy of the text of the CDDL should have accompanied this
   8    8   * source.  A copy of the CDDL is also available via the Internet at
   9    9   * http://www.illumos.org/license/CDDL.
  10   10   */
  11   11  
  12   12  /*
  13   13   * Copyright (c) 2013 Joyent, Inc.  All rights reserved.
       14 + * Copyright (c) 2015 Josef 'Jeff' Sipek <jeffpc@josefsipek.net>
  14   15   */
  15   16  
  16   17  
  17   18  #ifndef _SYS_BOOTCONF_H
  18   19  #define _SYS_BOOTCONF_H
  19   20  
  20   21  /*
  21   22   * Boot time configuration information objects
  22   23   */
  23   24  
↓ open down ↓ 6 lines elided ↑ open up ↑
  30   31  extern "C" {
  31   32  #endif
  32   33  
  33   34  /*
  34   35   * Masks for bsys_alloc memory allocator. These overlap with the ones for intel
  35   36   * and sun because they're used by the common kernel.
  36   37   */
  37   38  #define BO_NO_ALIGN     0x00001000
  38   39  #define BO_ALIGN_DONTCARE       -1
  39   40  
       41 +struct bsys_mem {
       42 +        struct memlist  physinstalled;
       43 +};
       44 +
  40   45  #define BO_VERSION      1       /* bootops interface revision */
  41   46  
  42   47  typedef struct bootops {
  43   48          uint_t  bsys_version;
       49 +        struct bsys_mem boot_mem;
  44   50          caddr_t (*bsys_alloc)(struct bootops *, caddr_t, size_t, int);
  45   51          void    (*bsys_free)(struct bootops *, caddr_t, size_t);
  46   52          int     (*bsys_getproplen)(struct bootops *, const char *);
  47   53          int     (*bsys_getprop)(struct bootops *, const char *, void *);
  48   54          void    (*bsys_printf)(struct bootops *, const char *, ...);
  49   55  } bootops_t;
  50   56  
  51   57  #define BOP_GETVERSION(bop)             ((bop)->bsys_version)
  52   58  #define BOP_ALLOC(bop, virthint, size, align)   \
  53   59                  ((bop)->bsys_alloc)(bop, virthint, size, align)
↓ open down ↓ 59 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX