Changeset 295ee02 in mainline


Ignore:
Timestamp:
2017-08-22T18:41:26Z (7 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
83b7f4d
Parents:
bb3ba51
Message:

riscv64: disable interrupts when halting the CPU
move all CPU-related control constants to arch/cpu.h

Location:
kernel/arch/riscv64
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/riscv64/include/arch/asm.h

    rbb3ba51 r295ee02  
    3636#define KERN_riscv64_ASM_H_
    3737
     38#include <arch/cpu.h>
    3839#include <typedefs.h>
    3940#include <config.h>
    4041#include <arch/mm/asid.h>
    4142#include <trace.h>
    42 
    43 #define SSTATUS_SIE_MASK  0x00000002
    4443
    4544NO_TRACE static inline ipl_t interrupts_enable(void)
  • kernel/arch/riscv64/include/arch/cpu.h

    rbb3ba51 r295ee02  
    3636#define KERN_riscv64_CPU_H_
    3737
     38#define SSTATUS_SIE_MASK  0x00000002
     39
     40#define SATP_PFN_MASK  UINT64_C(0x00000fffffffffff)
     41
     42#define SATP_MODE_MASK  UINT64_C(0xf000000000000000)
     43#define SATP_MODE_BARE  UINT64_C(0x0000000000000000)
     44#define SATP_MODE_SV39  UINT64_C(0x8000000000000000)
     45#define SATP_MODE_SV48  UINT64_C(0x9000000000000000)
     46
    3847#ifndef __ASM__
    3948
  • kernel/arch/riscv64/src/boot/boot.S

    rbb3ba51 r295ee02  
    2929#include <abi/asmtool.h>
    3030#include <arch/boot/boot.h>
     31#include <arch/cpu.h>
    3132
    3233.section K_TEXT_START, "ax"
     
    4647       
    4748        /* Not reached */
    48         /* FIXME: Disable interrupts */
     49        csrci sstatus, SSTATUS_SIE_MASK
    4950        hlt0:
    5051                wfi
  • kernel/arch/riscv64/src/mm/page.c

    rbb3ba51 r295ee02  
    3636#include <genarch/mm/page_pt.h>
    3737#include <arch/mm/frame.h>
     38#include <arch/cpu.h>
    3839#include <mm/frame.h>
    3940#include <mm/page.h>
     
    4748#include <print.h>
    4849#include <interrupt.h>
    49 
    50 #define SATP_PFN_MASK  UINT64_C(0x00000fffffffffff)
    51 
    52 #define SATP_MODE_MASK  UINT64_C(0xf000000000000000)
    53 #define SATP_MODE_BARE  UINT64_C(0x0000000000000000)
    54 #define SATP_MODE_SV39  UINT64_C(0x8000000000000000)
    55 #define SATP_MODE_SV48  UINT64_C(0x9000000000000000)
    5650
    5751void page_arch_init(void)
Note: See TracChangeset for help on using the changeset viewer.