Changeset 5eb5dcf in mainline for kernel/arch


Ignore:
Timestamp:
2010-01-06T20:56:04Z (16 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
fccc236
Parents:
002252a (diff), eca2435 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merge mainline changes

Location:
kernel/arch
Files:
2 added
12 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/amd64/src/amd64.c

    r002252a r5eb5dcf  
    212212                        i8042_wire(i8042_instance, kbrd);
    213213                        trap_virtual_enable_irqs(1 << IRQ_KBD);
     214                        trap_virtual_enable_irqs(1 << IRQ_MOUSE);
    214215                }
    215216        }
     
    219220         * self-sufficient.
    220221         */
    221         sysinfo_set_item_val("kbd", NULL, true);
    222         sysinfo_set_item_val("kbd.inr", NULL, IRQ_KBD);
    223         sysinfo_set_item_val("kbd.address.physical", NULL,
     222        sysinfo_set_item_val("i8042", NULL, true);
     223        sysinfo_set_item_val("i8042.inr_a", NULL, IRQ_KBD);
     224        sysinfo_set_item_val("i8042.inr_b", NULL, IRQ_MOUSE);
     225        sysinfo_set_item_val("i8042.address.physical", NULL,
    224226            (uintptr_t) I8042_BASE);
    225         sysinfo_set_item_val("kbd.address.kernel", NULL,
     227        sysinfo_set_item_val("i8042.address.kernel", NULL,
    226228            (uintptr_t) I8042_BASE);
    227229#endif
  • kernel/arch/amd64/src/interrupt.c

    r002252a r5eb5dcf  
    9898}
    9999
     100static void de_fault(int n, istate_t *istate)
     101{
     102        fault_if_from_uspace(istate, "Divide error.");
     103        decode_istate(n, istate);
     104        panic("Divide error.");
     105}
     106
    100107/** General Protection Fault. */
    101108static void gp_fault(int n, istate_t *istate)
     
    200207        }
    201208       
     209        exc_register(0, "de_fault", (iroutine) de_fault);
    202210        exc_register(7, "nm_fault", (iroutine) nm_fault);
    203211        exc_register(12, "ss_fault", (iroutine) ss_fault);
  • kernel/arch/arm32/Makefile.inc

    r002252a r5eb5dcf  
    6161        arch/$(KARCH)/src/mm/page.c \
    6262        arch/$(KARCH)/src/mm/tlb.c \
    63         arch/$(KARCH)/src/mm/page_fault.c
     63        arch/$(KARCH)/src/mm/page_fault.c \
     64        arch/$(KARCH)/src/ras.c
    6465
    6566ifeq ($(MACHINE),testarm)
  • kernel/arch/arm32/include/mm/as.h

    r002252a r5eb5dcf  
    5454#define as_destructor_arch(as)                  (as != as)
    5555#define as_create_arch(as, flags)               (as != as)
    56 #define as_install_arch(as)
    5756#define as_deinstall_arch(as)
    5857#define as_invalidate_translation_cache(as, page, cnt)
  • kernel/arch/arm32/src/arm32.c

    r002252a r5eb5dcf  
    4848#include <macros.h>
    4949#include <string.h>
     50#include <arch/ras.h>
    5051
    5152#ifdef MACHINE_testarm
     
    8889        exception_init();
    8990        interrupt_init();
     91
     92        /* Initialize Restartable Atomic Sequences support. */
     93        ras_init();
    9094       
    9195        machine_output_init();
     
    136140        uint8_t *stck;
    137141       
    138         tlb_invalidate_all();
    139142        stck = &THREAD->kstack[THREAD_STACK_SIZE - SP_DELTA];
    140143        supervisor_sp = (uintptr_t) stck;
  • kernel/arch/arm32/src/exc_handler.S

    r002252a r5eb5dcf  
    148148        mov r0, #0
    149149        mov r1, r13
    150         bl exc_dispatch
     150        bl ras_check
    151151        LOAD_REGS_FROM_STACK
    152152
     
    156156        mov r0, #5
    157157        mov r1, r13
    158         bl exc_dispatch
     158        bl ras_check
    159159        LOAD_REGS_FROM_STACK
    160160
     
    164164        mov r0, #6
    165165        mov r1, r13
    166         bl exc_dispatch
     166        bl ras_check
    167167        LOAD_REGS_FROM_STACK
    168168
     
    171171        mov r0, #1
    172172        mov r1, r13
    173         bl exc_dispatch
     173        bl ras_check
    174174        LOAD_REGS_FROM_STACK
    175175
     
    179179        mov r0, #3
    180180        mov r1, r13
    181         bl exc_dispatch
     181        bl ras_check
    182182        LOAD_REGS_FROM_STACK
    183183
     
    187187        mov r0, #4
    188188        mov r1, r13
    189         bl exc_dispatch
     189        bl ras_check
    190190        LOAD_REGS_FROM_STACK
    191191
     
    195195        mov r0, #2
    196196        mov r1, r13
    197         bl exc_dispatch
     197        bl ras_check
    198198        LOAD_REGS_FROM_STACK
    199199
  • kernel/arch/arm32/src/mm/as.c

    r002252a r5eb5dcf  
    3939#include <genarch/mm/asid_fifo.h>
    4040#include <mm/as.h>
     41#include <mm/tlb.h>
    4142#include <arch.h>
    4243
     
    5051}
    5152
     53void as_install_arch(as_t *as)
     54{
     55        tlb_invalidate_all();
     56}
     57
    5258/** @}
    5359 */
  • kernel/arch/arm32/src/userspace.c

    r002252a r5eb5dcf  
    3535
    3636#include <userspace.h>
     37#include <arch/ras.h>
    3738
    3839/** Struct for holding all general purpose registers.
     
    7475        ustate.r1 = 0;
    7576
     77        /* pass the RAS page address in %r2 */
     78        ustate.r2 = (uintptr_t) ras_page;
     79
    7680        /* clear other registers */
    77         ustate.r2 = ustate.r3  = ustate.r4  = ustate.r5 =
    78             ustate.r6  = ustate.r7  = ustate.r8  = ustate.r9 = ustate.r10 =
    79             ustate.r11 = ustate.r12 = ustate.lr = 0;
     81        ustate.r3  = ustate.r4  = ustate.r5 = ustate.r6 = ustate.r7 =
     82            ustate.r8 = ustate.r9 = ustate.r10 = ustate.r11 = ustate.r12 =
     83            ustate.lr = 0;
    8084
    8185        /* set user stack */
  • kernel/arch/ia32/src/ia32.c

    r002252a r5eb5dcf  
    170170                        i8042_wire(i8042_instance, kbrd);
    171171                        trap_virtual_enable_irqs(1 << IRQ_KBD);
     172                        trap_virtual_enable_irqs(1 << IRQ_MOUSE);
    172173                }
    173174        }
     
    177178         * self-sufficient.
    178179         */
    179         sysinfo_set_item_val("kbd", NULL, true);
    180         sysinfo_set_item_val("kbd.inr", NULL, IRQ_KBD);
    181         sysinfo_set_item_val("kbd.address.physical", NULL,
     180        sysinfo_set_item_val("i8042", NULL, true);
     181        sysinfo_set_item_val("i8042.inr_a", NULL, IRQ_KBD);
     182        sysinfo_set_item_val("i8042.inr_b", NULL, IRQ_MOUSE);
     183        sysinfo_set_item_val("i8042.address.physical", NULL,
    182184            (uintptr_t) I8042_BASE);
    183         sysinfo_set_item_val("kbd.address.kernel", NULL,
     185        sysinfo_set_item_val("i8042.address.kernel", NULL,
    184186            (uintptr_t) I8042_BASE);
    185187#endif
  • kernel/arch/ia32/src/interrupt.c

    r002252a r5eb5dcf  
    9898}
    9999
     100static void de_fault(int n, istate_t *istate)
     101{
     102        fault_if_from_uspace(istate, "Divide error.");
     103
     104        decode_istate(istate);
     105        panic("Divide error.");
     106}
     107
    100108/** General Protection Fault. */
    101109static void gp_fault(int n __attribute__((unused)), istate_t *istate)
     
    215223        }
    216224       
     225        exc_register(0, "de_fault", (iroutine) de_fault);
    217226        exc_register(7, "nm_fault", (iroutine) nm_fault);
    218227        exc_register(12, "ss_fault", (iroutine) ss_fault);
  • kernel/arch/sparc64/src/context.S

    r002252a r5eb5dcf  
    2828
    2929#include <arch/context_offset.h>
    30 
    31 /**
    32  * Both context_save_arch() and context_restore_arch() are
    33  * leaf-optimized procedures. This kind of optimization
    34  * is very important and prevents any implicit window
    35  * spill/fill/clean traps in these very core kernel
    36  * functions.
    37  */
    38        
    39 #include <arch/context_offset.h>
     30#include <arch/arch.h>
     31#include <arch/regdef.h>
    4032
    4133.text   
     
    4436.global context_restore_arch
    4537
     38/*
     39 * context_save_arch() is required not to create its own stack frame. See the
     40 * generic context.h for explanation.
     41 */
    4642context_save_arch:
     43        #
     44        # Force all our active register windows to memory so that we can find
     45        # them there even if e.g. the thread is migrated to another processor.
     46        #
     47        flushw
     48
    4749        CONTEXT_SAVE_ARCH_CORE %o0
    4850        retl
     
    5153context_restore_arch:
    5254        #
    53         # Flush all active windows.
    54         # This is essential, because CONTEXT_LOAD overwrites
    55         # %sp of CWP - 1 with the value written to %fp of CWP.
    56         # Flushing all active windows mitigates this problem
    57         # as CWP - 1 becomes the overlap window.
     55        # Forget all previous windows, they are not going to be needed again.
     56        # Enforce a window fill on the next RESTORE instruction by setting
     57        # CANRESTORE to zero and other window configuration registers
     58        # accordingly. Note that the same can be achieved by executing the
     59        # FLUSHW instruction, but since we don't need to remember the previous
     60        # windows, we do the former and save thus some unnecessary window
     61        # spills.
    5862        #
    59         flushw
    60        
     63        rdpr %pstate, %l0
     64        andn %l0, PSTATE_IE_BIT, %l1
     65        wrpr %l1, %pstate
     66        wrpr %g0, 0, %canrestore
     67        wrpr %g0, 0, %otherwin
     68        wrpr %g0, NWINDOWS - 2, %cansave
     69        wrpr %l0, %pstate
     70
    6171        CONTEXT_RESTORE_ARCH_CORE %o0
    6272        retl
  • kernel/arch/sparc64/src/trap/trap_table.S

    r002252a r5eb5dcf  
    652652         * spilled to kernel memory (i.e. register window buffer). Moreover,
    653653         * if the scheduler was called in the meantime, all valid windows
    654          * belonging to other threads were spilled by context_restore().
     654         * belonging to other threads were spilled by context_save().
    655655         * If OTHERWIN is non-zero, then some userspace windows are still
    656656         * valid. Others might have been spilled. However, the CWP pointer
Note: See TracChangeset for help on using the changeset viewer.