Changeset 84060e2 in mainline for kernel/arch/sparc64/src/cpu/cpu.c


Ignore:
Timestamp:
2006-10-09T19:29:42Z (18 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
8ce8499
Parents:
e4398200
Message:

sparc64 work:

  • hw_map() can now support up to 8M requests
  • CPU stacks are now locked in DTLB of the respective processor
  • kernel in the boot phase no longer relies on the stack provided by OpenFirmware
  • instead of of doing FLUSHW during kernel startup, simply set the window state registers to the wanted state
  • NWINDOW → NWINDOWS
  • Add/fix some comments and copyrights.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/sparc64/src/cpu/cpu.c

    re4398200 r84060e2  
    4141#include <arch/types.h>
    4242#include <arch/drivers/tick.h>
     43#include <arch/mm/page.h>
     44#include <arch/mm/tlb.h>
     45#include <macros.h>
    4346
    4447/** Perform sparc64 specific initialization of the processor structure for the current processor. */
     
    5356        CPU->arch.mid = upa_config.mid;
    5457       
     58        /*
     59         * Detect processor frequency.
     60         */
    5561        node = ofw_tree_find_child_by_device_type(ofw_tree_lookup("/"), "cpu");
    5662        while (node) {
     
    7177        CPU->arch.clock_frequency = clock_frequency;
    7278        tick_init();
     79       
     80        /*
     81         * Lock CPU stack in DTLB.
     82         */
     83        uintptr_t base = ALIGN_DOWN(config.base, 1<<KERNEL_PAGE_WIDTH);
     84                 
     85        if (!overlaps((uintptr_t) CPU->stack, PAGE_SIZE, base, (1<<KERNEL_PAGE_WIDTH))) {
     86                /*
     87                 * Kernel stack of this processor is not locked in DTLB.
     88                 * First, demap any already existing mappings.
     89                 * Second, create a locked mapping for it.
     90                 */
     91                dtlb_demap(TLB_DEMAP_PAGE, TLB_DEMAP_NUCLEUS, (uintptr_t) CPU->stack);
     92                dtlb_insert_mapping((uintptr_t) CPU->stack, KA2PA(CPU->stack), PAGESIZE_8K, true, true);
     93        }
     94
    7395}
    7496
Note: See TracChangeset for help on using the changeset viewer.