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

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/armv6/os/fakebop.c
          +++ new/usr/src/uts/armv6/os/fakebop.c
↓ open down ↓ 80 lines elided ↑ open up ↑
  81   81  #define BI_HAS_RAMDISK  0x1
  82   82  
  83   83  /*
  84   84   * TODO Generalize this
  85   85   * This is the set of information tha we want to gather from the various atag
  86   86   * headers. This is simple and naive and will need to evolve as we have
  87   87   * additional boards beyond just the RPi.
  88   88   */
  89   89  typedef struct bootinfo {
  90   90          uint_t          bi_flags;
  91      -        uint32_t        bi_memsize;
  92      -        uint32_t        bi_memstart;
  93   91          char            *bi_cmdline;
  94   92          uint32_t        bi_ramdisk;
  95   93          uint32_t        bi_ramsize;
  96   94  } bootinfo_t;
  97   95  
  98   96  static bootinfo_t bootinfo;     /* Simple set of boot information */
  99   97  
 100   98  static struct boot_syscalls bop_sysp = {
 101   99          bcons_getchar,
 102  100          bcons_putchar,
↓ open down ↓ 265 lines elided ↑ open up ↑
 368  366                           * system has discontiguous physical memory
 369  367                           */
 370  368                          if (got_mem) {
 371  369                                  bop_printf(NULL, "found multiple ATAG_MEM\n");
 372  370                                  bop_printf(NULL, "ignoring: %#x - %#x\n",
 373  371                                      amp->am_start, amp->am_start +
 374  372                                      amp->am_size - 1);
 375  373                                  break;
 376  374                          }
 377  375  
 378      -                        bp->bi_memsize = amp->am_size;
 379      -                        bp->bi_memstart = amp->am_start;
      376 +                        bootop.boot_mem.physinstalled.ml_address = amp->am_start;
      377 +                        bootop.boot_mem.physinstalled.ml_size = amp->am_size;
      378 +                        bootop.boot_mem.physinstalled.ml_prev = NULL;
      379 +                        bootop.boot_mem.physinstalled.ml_next = NULL;
 380  380                          got_mem = B_TRUE;
 381  381                          break;
 382  382                  case ATAG_CMDLINE:
 383  383                          alp = (atag_cmdline_t *)ahp;
 384  384                          bp->bi_cmdline = alp->al_cmdline;
 385  385                          break;
 386  386                  case ATAG_ILLUMOS_STATUS:
 387  387                          aisp = (atag_illumos_status_t *)ahp;
 388  388                          bp->bi_ramdisk = aisp->ais_archive;
 389  389                          bp->bi_ramsize = aisp->ais_archivelen;
↓ open down ↓ 537 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX