Print this page
unix: enable caches in locore
The loader should really be as simple as possible to be as small as
possible.  It should configure the machine so that unix can make certain
assumptions but it should leave more complex initialization to unix.

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/armv6/loader/fakeloader.c
          +++ new/usr/src/uts/armv6/loader/fakeloader.c
↓ open down ↓ 27 lines elided ↑ open up ↑
  28   28  /*
  29   29   * This is the stock ARM fake uniboot loader.
  30   30   *
  31   31   * Here's what we have to do:
  32   32   *   o Read the atag header and find the combined archive header
  33   33   *   o Determine the set of mappings we need to add for the following:
  34   34   *              - unix
  35   35   *              - boot_archive
  36   36   *              - atags
  37   37   *   o Enable unaligned access
  38      - *   o Enable the caches + virtual memory
       38 + *   o Enable virtual memory
  39   39   *
  40   40   * There are several important constraints that we have here:
  41   41   *
  42   42   *   o We cannot use any .data! Several loaders that come before us are broken
  43   43   *     and only provide us with the ability to map our .text and potentially our
  44   44   *     .bss. We should strive to avoid even that if we can.
  45   45   */
  46   46  
  47   47  #ifdef  DEBUG
  48   48  #define FAKELOAD_DPRINTF(x)     fakeload_puts(x)
↓ open down ↓ 646 lines elided ↑ open up ↑
 695  695          /* Program the page tables */
 696  696          FAKELOAD_DPRINTF("programming cp15 regs\n");
 697  697          fakeload_pt_setup((uintptr_t)pt_addr);
 698  698  
 699  699  
 700  700          /* MMU Enable */
 701  701          FAKELOAD_DPRINTF("see you on the other side\n");
 702  702          fakeload_mmu_enable();
 703  703  
 704  704          FAKELOAD_DPRINTF("why helo thar\n");
 705      -
 706      -        /* Renable caches */
 707      -        armv6_dcache_enable();
 708      -        armv6_icache_enable();
 709  705  
 710  706          /* we should never come back */
 711  707          fakeload_exec(ident, ident2, chain, unix_start);
 712  708          fakeload_panic("hit the end of the world\n");
 713  709  }
    
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX