Changeset 7e7c8747 in mainline for kernel/arch/sparc64/src/start.S


Ignore:
Timestamp:
2006-12-17T12:11:00Z (18 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
95155b0c
Parents:
771cd22
Message:

More formatting and indentation changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/sparc64/src/start.S

    r771cd22 r7e7c8747  
    7878
    7979        wrpr %g0, NWINDOWS - 2, %cansave        ! set maximum saveable windows
    80         wrpr %g0, 0, %canrestore                ! get rid of windows we will never need again
    81         wrpr %g0, 0, %otherwin                  ! make sure the window state is consistent
    82         wrpr %g0, NWINDOWS - 1, %cleanwin       ! prevent needless clean_window traps for kernel
    83 
    84         wrpr %g0, 0, %tl                        ! TL = 0, primary context register is used
    85 
    86         wrpr %g0, PSTATE_PRIV_BIT, %pstate      ! Disable interrupts and disable 32-bit address masking.
     80        wrpr %g0, 0, %canrestore                ! get rid of windows we will
     81                                                ! never need again
     82        wrpr %g0, 0, %otherwin                  ! make sure the window state is
     83                                                ! consistent
     84        wrpr %g0, NWINDOWS - 1, %cleanwin       ! prevent needless clean_window
     85                                                ! traps for kernel
     86
     87        wrpr %g0, 0, %tl                        ! TL = 0, primary context
     88                                                ! register is used
     89
     90        wrpr %g0, PSTATE_PRIV_BIT, %pstate      ! disable interrupts and disable
     91                                                ! 32-bit address masking
    8792
    8893        wrpr %g0, 0, %pil                       ! intialize %pil
     
    95100
    96101        /*
    97          * Take over the DMMU by installing global locked
    98          * TTE entry identically mapping the first 4M
    99          * of memory.
     102         * Take over the DMMU by installing global locked TTE entry identically
     103         * mapping the first 4M of memory.
    100104         *
    101          * In case of DMMU, no FLUSH instructions need to be
    102          * issued. Because of that, the old DTLB contents can
    103          * be demapped pretty straightforwardly and without
    104          * causing any traps.
     105         * In case of DMMU, no FLUSH instructions need to be issued. Because of
     106         * that, the old DTLB contents can be demapped pretty straightforwardly
     107         * and without causing any traps.
    105108         */
    106109
     
    108111
    109112#define SET_TLB_DEMAP_CMD(r1, context_id) \
    110         set (TLB_DEMAP_CONTEXT<<TLB_DEMAP_TYPE_SHIFT) | (context_id<<TLB_DEMAP_CONTEXT_SHIFT), %r1
     113        set (TLB_DEMAP_CONTEXT << TLB_DEMAP_TYPE_SHIFT) | (context_id << \
     114                TLB_DEMAP_CONTEXT_SHIFT), %r1
    111115       
    112116        ! demap context 0
     
    116120
    117121#define SET_TLB_TAG(r1, context) \
    118         set VMA | (context<<TLB_TAG_ACCESS_CONTEXT_SHIFT), %r1
     122        set VMA | (context << TLB_TAG_ACCESS_CONTEXT_SHIFT), %r1
    119123
    120124        ! write DTLB tag
     
    145149
    146150        /*
    147          * Because we cannot use global mappings (because we want to
    148          * have separate 64-bit address spaces for both the kernel
    149          * and the userspace), we prepare the identity mapping also in
    150          * context 1. This step is required by the
    151          * code installing the ITLB mapping.
     151         * Because we cannot use global mappings (because we want to have
     152         * separate 64-bit address spaces for both the kernel and the
     153         * userspace), we prepare the identity mapping also in context 1. This
     154         * step is required by the code installing the ITLB mapping.
    152155         */
    153156        ! write DTLB tag of context 1 (i.e. MEM_CONTEXT_TEMP)
     
    162165       
    163166        /*
    164          * Now is time to take over the IMMU.
    165          * Unfortunatelly, it cannot be done as easily as the DMMU,
    166          * because the IMMU is mapping the code it executes.
     167         * Now is time to take over the IMMU. Unfortunatelly, it cannot be done
     168         * as easily as the DMMU, because the IMMU is mapping the code it
     169         * executes.
    167170         *
    168          * [ Note that brave experiments with disabling the IMMU
    169          * and using the DMMU approach failed after a dozen
    170          * of desparate days with only little success. ]
     171         * [ Note that brave experiments with disabling the IMMU and using the
     172         * DMMU approach failed after a dozen of desparate days with only little
     173         * success. ]
    171174         *
    172          * The approach used here is inspired from OpenBSD.
    173          * First, the kernel creates IMMU mapping for itself
    174          * in context 1 (MEM_CONTEXT_TEMP) and switches to
    175          * it. Context 0 (MEM_CONTEXT_KERNEL) can be demapped
    176          * afterwards and replaced with the kernel permanent
    177          * mapping. Finally, the kernel switches back to
    178          * context 0 and demaps context 1.
     175         * The approach used here is inspired from OpenBSD. First, the kernel
     176         * creates IMMU mapping for itself in context 1 (MEM_CONTEXT_TEMP) and
     177         * switches to it. Context 0 (MEM_CONTEXT_KERNEL) can be demapped
     178         * afterwards and replaced with the kernel permanent mapping. Finally,
     179         * the kernel switches back to context 0 and demaps context 1.
    179180         *
    180          * Moreover, the IMMU requires use of the FLUSH instructions.
    181          * But that is OK because we always use operands with
    182          * addresses already mapped by the taken over DTLB.
     181         * Moreover, the IMMU requires use of the FLUSH instructions. But that
     182         * is OK because we always use operands with addresses already mapped by
     183         * the taken over DTLB.
    183184         */
    184185       
     
    292293#ifdef CONFIG_SMP
    293294        /*
    294          * Active loop for APs until the BSP picks them up.
    295          * A processor cannot leave the loop until the
    296          * global variable 'waking_up_mid' equals its
     295         * Active loop for APs until the BSP picks them up. A processor cannot
     296         * leave the loop until the global variable 'waking_up_mid' equals its
    297297         * MID.
    298298         */
     
    327327
    328328/*
    329  * Create small stack to be used by the bootstrap processor.
    330  * It is going to be used only for a very limited period of
    331  * time, but we switch to it anyway, just to be sure we are
    332  * properly initialized.
     329 * Create small stack to be used by the bootstrap processor. It is going to be
     330 * used only for a very limited period of time, but we switch to it anyway,
     331 * just to be sure we are properly initialized.
    333332 *
    334  * What is important is that this piece of memory is covered
    335  * by the 4M DTLB locked entry and therefore there will be
    336  * no surprises like deadly combinations of spill trap and
    337  * and TLB miss on the stack address.
     333 * What is important is that this piece of memory is covered by the 4M DTLB
     334 * locked entry and therefore there will be no surprises like deadly
     335 * combinations of spill trap and and TLB miss on the stack address.
    338336 */
    339337
     
    355353
    356354/*
    357  * This variable is used by the fast_data_MMU_miss trap handler.
    358  * In runtime, it is further modified to reflect the starting address of
    359  * physical memory.
     355 * This variable is used by the fast_data_MMU_miss trap handler. In runtime, it
     356 * is further modified to reflect the starting address of physical memory.
    360357 */
    361358.global kernel_8k_tlb_data_template
    362359kernel_8k_tlb_data_template:
    363360#ifdef CONFIG_VIRT_IDX_DCACHE
    364         .quad ((1 << TTE_V_SHIFT) | (PAGESIZE_8K << TTE_SIZE_SHIFT) | TTE_CP | TTE_CV | TTE_P | TTE_W)
     361        .quad ((1 << TTE_V_SHIFT) | (PAGESIZE_8K << TTE_SIZE_SHIFT) | TTE_CP | \
     362                 TTE_CV | TTE_P | TTE_W)
    365363#else /* CONFIG_VIRT_IDX_DCACHE */
    366         .quad ((1 << TTE_V_SHIFT) | (PAGESIZE_8K << TTE_SIZE_SHIFT) | TTE_CP | TTE_P | TTE_W)
     364        .quad ((1 << TTE_V_SHIFT) | (PAGESIZE_8K << TTE_SIZE_SHIFT) | TTE_CP | \
     365                TTE_P | TTE_W)
    367366#endif /* CONFIG_VIRT_IDX_DCACHE */
     367
Note: See TracChangeset for help on using the changeset viewer.