Changeset c0699467 in mainline for kernel/arch


Ignore:
Timestamp:
2011-08-09T18:08:23Z (15 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
b538ca5c
Parents:
3666d386
Message:

do not provide general access to kernel headers from uspace, only allow specific headers to be accessed or shared
externalize headers which serve as kernel/uspace API/ABI into a special tree

Location:
kernel/arch
Files:
65 edited
1 moved

Legend:

Unmodified
Added
Removed
  • kernel/arch/abs32le/include/istate.h

    r3666d386 rc0699467  
    3636#define KERN_abs32le_ISTATE_H_
    3737
     38#include <trace.h>
     39
    3840#ifdef KERNEL
    3941
    40 #include <typedefs.h>
    4142#include <verify.h>
    42 #include <trace.h>
    4343
    4444#else /* KERNEL */
    4545
    46 #include <sys/types.h>
    47 
    48 #define NO_TRACE
    4946#define REQUIRES_EXTENT_MUTABLE(arg)
    5047#define WRITES(arg)
  • kernel/arch/abs32le/include/mm/frame.h

    r3666d386 rc0699467  
    3939#define FRAME_SIZE   (1 << FRAME_WIDTH)
    4040
    41 #ifdef KERNEL
    42 
    4341#include <typedefs.h>
    4442
     
    4644extern void physmem_print(void);
    4745
    48 #endif /* KERNEL */
    49 
    5046#endif
    5147
  • kernel/arch/abs32le/include/mm/page.h

    r3666d386 rc0699467  
    4141#define PAGE_WIDTH  FRAME_WIDTH
    4242#define PAGE_SIZE   FRAME_SIZE
    43 
    44 #ifdef KERNEL
    4543
    4644#define KA2PA(x)  (((uintptr_t) (x)) - UINT32_C(0x80000000))
     
    178176extern void page_fault(unsigned int, istate_t *);
    179177
    180 #endif /* KERNEL */
    181 
    182178#endif
    183179
  • kernel/arch/abs32le/src/userspace.c

    r3666d386 rc0699467  
    3636#include <typedefs.h>
    3737#include <arch.h>
    38 #include <proc/uarg.h>
     38#include <abi/proc/uarg.h>
    3939#include <mm/as.h>
    40 
    4140
    4241void userspace(uspace_arg_t *kernel_uarg)
  • kernel/arch/amd64/include/context.h

    r3666d386 rc0699467  
    3636#define KERN_amd64_CONTEXT_H_
    3737
    38 #ifdef KERNEL
    39 
    4038#include <typedefs.h>
    4139
     
    5250                (c)->rbp = 0; \
    5351        } while (0)
    54 
    55 #endif /* KERNEL */
    5652
    5753/* We include only registers that must be preserved
  • kernel/arch/amd64/include/istate.h

    r3666d386 rc0699467  
    3636#define KERN_amd64_ISTATE_H_
    3737
    38 #ifdef KERNEL
    39 
    40 #include <typedefs.h>
    4138#include <trace.h>
    42 
    43 #else /* KERNEL */
    44 
    45 #include <sys/types.h>
    46 
    47 #define NO_TRACE
    48 
    49 #endif /* KERNEL */
    5039
    5140/** This is passed to interrupt handlers */
  • kernel/arch/amd64/include/mm/frame.h

    r3666d386 rc0699467  
    3939#define FRAME_SIZE   (1 << FRAME_WIDTH)
    4040
    41 #ifdef KERNEL
    4241#ifndef __ASM__
    4342
     
    4948
    5049#endif /* __ASM__ */
    51 #endif /* KERNEL */
    5250
    5351#endif
  • kernel/arch/amd64/include/mm/page.h

    r3666d386 rc0699467  
    5050#define PAGE_WIDTH  FRAME_WIDTH
    5151#define PAGE_SIZE   FRAME_SIZE
    52 
    53 #ifdef KERNEL
    5452
    5553#ifndef __ASM__
     
    231229#endif /* __ASM__ */
    232230
    233 #endif /* KERNEL */
    234 
    235231#endif
    236232
  • kernel/arch/amd64/src/userspace.c

    r3666d386 rc0699467  
    3838#include <typedefs.h>
    3939#include <arch.h>
    40 #include <proc/uarg.h>
     40#include <abi/proc/uarg.h>
    4141#include <mm/as.h>
    42 
    4342
    4443/** Enter userspace
  • kernel/arch/arm32/include/istate.h

    r3666d386 rc0699467  
    3535#define KERN_arm32_ISTATE_H_
    3636
     37#include <trace.h>
     38
     39#ifdef KERNEL
     40
    3741#include <arch/regutils.h>
    3842
    39 #ifdef KERNEL
    40 #include <typedefs.h>
    41 #include <trace.h>
    42 #else
    43 #include <sys/types.h>
    44 #define NO_TRACE
    45 #endif
     43#else /* KERNEL */
     44
     45#include <libarch/regutils.h>
     46
     47#endif /* KERNEL */
    4648
    4749/** Struct representing CPU state saved when an exception occurs. */
  • kernel/arch/arm32/include/mm/frame.h

    r3666d386 rc0699467  
    4040#define FRAME_SIZE   (1 << FRAME_WIDTH)
    4141
    42 #ifdef KERNEL
    4342#ifndef __ASM__
    4443
     
    6968
    7069#endif /* __ASM__ */
    71 #endif /* KERNEL */
    7270
    7371#endif
  • kernel/arch/arm32/include/mm/page.h

    r3666d386 rc0699467  
    5252#       define PA2KA(x) ((x) + 0x80000000)
    5353#endif
    54 
    55 #ifdef KERNEL
    5654
    5755/* Number of entries in each level. */
     
    320318#endif /* __ASM__ */
    321319
    322 #endif /* KERNEL */
    323 
    324320#endif
    325321
  • kernel/arch/arm32/include/regutils.h

    r3666d386 rc0699467  
    3030 * @{
    3131 */
    32 /** 
     32/**
    3333 * @file
    3434 * @brief Utilities for convenient manipulation with ARM registers.
     
    3838#define KERN_arm32_REGUTILS_H_
    3939
    40 #define STATUS_REG_IRQ_DISABLED_BIT (1 << 7)
    41 #define STATUS_REG_MODE_MASK        0x1f
     40#define STATUS_REG_IRQ_DISABLED_BIT  (1 << 7)
     41#define STATUS_REG_MODE_MASK         0x1f
    4242
    43 #define CP15_R1_HIGH_VECTORS_BIT    (1 << 13)
    44 
     43#define CP15_R1_HIGH_VECTORS_BIT     (1 << 13)
    4544
    4645/* ARM Processor Operation Modes */
    47 #define USER_MODE         0x10
    48 #define FIQ_MODE          0x11
    49 #define IRQ_MODE          0x12
    50 #define SUPERVISOR_MODE   0x13
    51 #define ABORT_MODE        0x17
    52 #define UNDEFINED_MODE    0x1b
    53 #define SYSTEM_MODE       0x1f
     46#define USER_MODE        0x10
     47#define FIQ_MODE         0x11
     48#define IRQ_MODE         0x12
     49#define SUPERVISOR_MODE  0x13
     50#define ABORT_MODE       0x17
     51#define UNDEFINED_MODE   0x1b
     52#define SYSTEM_MODE      0x1f
    5453
    5554/* [CS]PRS manipulation macros */
    56 #define GEN_STATUS_READ(nm,reg) \
    57 static inline uint32_t nm## _status_reg_read(void) \
    58 { \
    59         uint32_t retval; \
    60         asm volatile( \
    61                 "mrs %[retval], " #reg \
    62                 : [retval] "=r" (retval) \
    63         ); \
    64         return retval; \
    65 }
     55#define GEN_STATUS_READ(nm, reg) \
     56        static inline uint32_t nm## _status_reg_read(void) \
     57        { \
     58                uint32_t retval; \
     59                \
     60                asm volatile ( \
     61                        "mrs %[retval], " #reg \
     62                        : [retval] "=r" (retval) \
     63                ); \
     64                \
     65                return retval; \
     66        }
    6667
    67 #define GEN_STATUS_WRITE(nm,reg,fieldname, field) \
    68 static inline void nm## _status_reg_ ##fieldname## _write(uint32_t value) \
    69 { \
    70         asm volatile( \
    71                 "msr " #reg "_" #field ", %[value]" \
    72                 :: [value] "r" (value) \
    73         ); \
    74 }
     68#define GEN_STATUS_WRITE(nm, reg, fieldname, field) \
     69        static inline void nm## _status_reg_ ##fieldname## _write(uint32_t value) \
     70        { \
     71                asm volatile ( \
     72                        "msr " #reg "_" #field ", %[value]" \
     73                        :: [value] "r" (value) \
     74                ); \
     75        }
    7576
     77/** Return the value of CPSR (Current Program Status Register). */
     78GEN_STATUS_READ(current, cpsr);
    7679
    77 /** Returns the value of CPSR (Current Program Status Register). */
    78 GEN_STATUS_READ(current, cpsr)
    79 
    80 
    81 /** Sets control bits of CPSR. */
     80/** Set control bits of CPSR. */
    8281GEN_STATUS_WRITE(current, cpsr, control, c);
    8382
    84 
    85 /** Returns the value of SPSR (Saved Program Status Register). */
    86 GEN_STATUS_READ(saved, spsr)
    87 
     83/** Return the value of SPSR (Saved Program Status Register). */
     84GEN_STATUS_READ(saved, spsr);
    8885
    8986#endif
  • kernel/arch/arm32/src/arm32.c

    r3666d386 rc0699467  
    3737#include <config.h>
    3838#include <genarch/fb/fb.h>
    39 #include <genarch/fb/visuals.h>
     39#include <abi/fb/visuals.h>
    4040#include <sysinfo/sysinfo.h>
    4141#include <console/console.h>
  • kernel/arch/arm32/src/mach/gta02/gta02.c

    r3666d386 rc0699467  
    3939#include <mm/page.h>
    4040#include <genarch/fb/fb.h>
    41 #include <genarch/fb/visuals.h>
     41#include <abi/fb/visuals.h>
    4242#include <genarch/drivers/s3c24xx_uart/s3c24xx_uart.h>
    4343#include <genarch/drivers/s3c24xx_irqc/s3c24xx_irqc.h>
  • kernel/arch/arm32/src/mach/integratorcp/integratorcp.c

    r3666d386 rc0699467  
    4848#include <arch/mach/integratorcp/integratorcp.h>
    4949#include <genarch/fb/fb.h>
    50 #include <genarch/fb/visuals.h>
     50#include <abi/fb/visuals.h>
    5151#include <ddi/ddi.h>
    5252#include <print.h>
  • kernel/arch/arm32/src/mach/testarm/testarm.c

    r3666d386 rc0699467  
    3838#include <mm/page.h>
    3939#include <genarch/fb/fb.h>
    40 #include <genarch/fb/visuals.h>
     40#include <abi/fb/visuals.h>
    4141#include <genarch/drivers/dsrln/dsrlnin.h>
    4242#include <genarch/drivers/dsrln/dsrlnout.h>
  • kernel/arch/ia32/include/context.h

    r3666d386 rc0699467  
    3636#define KERN_ia32_CONTEXT_H_
    3737
    38 #ifdef KERNEL
    39 
    4038#include <typedefs.h>
    4139
     
    5755        } while (0)
    5856
    59 #endif /* KERNEL */
    60 
    6157/*
    6258 * Only save registers that must be preserved across
  • kernel/arch/ia32/include/elf.h

    r3666d386 rc0699467  
    2727 */
    2828
    29 /** @addtogroup ia32   
     29/** @addtogroup ia32
    3030 * @{
    3131 */
     
    3636#define KERN_ia32_ELF_H_
    3737
    38 #define ELF_MACHINE             EM_386
    39 #define ELF_DATA_ENCODING       ELFDATA2LSB
    40 #define ELF_CLASS               ELFCLASS32
     38#define ELF_MACHINE        EM_386
     39#define ELF_DATA_ENCODING  ELFDATA2LSB
     40#define ELF_CLASS          ELFCLASS32
    4141
    4242#endif
  • kernel/arch/ia32/include/istate.h

    r3666d386 rc0699467  
    3636#define KERN_ia32_ISTATE_H_
    3737
    38 #ifdef KERNEL
    39 
    40 #include <typedefs.h>
    4138#include <trace.h>
    42 
    43 #else /* KERNEL */
    44 
    45 #include <sys/types.h>
    46 
    47 #define NO_TRACE
    48 
    49 #endif /* KERNEL */
    5039
    5140typedef struct istate {
  • kernel/arch/ia32/include/mm/frame.h

    r3666d386 rc0699467  
    3939#define FRAME_SIZE   (1 << FRAME_WIDTH)
    4040
    41 #ifdef KERNEL
    4241#ifndef __ASM__
    4342
     
    5049
    5150#endif /* __ASM__ */
    52 #endif /* KERNEL */
    5351
    5452#endif
  • kernel/arch/ia32/include/mm/page.h

    r3666d386 rc0699467  
    4242#define PAGE_SIZE   FRAME_SIZE
    4343
    44 #ifdef KERNEL
    45 
    4644#ifndef __ASM__
    4745
     
    201199#endif /* __ASM__ */
    202200
    203 #endif /* KERNEL */
    204 
    205201#endif
    206202
  • kernel/arch/ia32/src/drivers/vesa.c

    r3666d386 rc0699467  
    3838
    3939#include <genarch/fb/fb.h>
    40 #include <genarch/fb/visuals.h>
    4140#include <arch/drivers/vesa.h>
    4241#include <console/chardev.h>
  • kernel/arch/ia32/src/smp/smp.c

    r3666d386 rc0699467  
    4242#include <config.h>
    4343#include <synch/waitq.h>
    44 #include <synch/synch.h>
    4544#include <arch/pm.h>
    4645#include <func.h>
  • kernel/arch/ia32/src/userspace.c

    r3666d386 rc0699467  
    3737#include <typedefs.h>
    3838#include <arch.h>
    39 #include <proc/uarg.h>
     39#include <abi/proc/uarg.h>
    4040#include <mm/as.h>
    41 
    4241
    4342/** Enter userspace
  • kernel/arch/ia64/include/elf.h

    r3666d386 rc0699467  
    2727 */
    2828
    29 /** @addtogroup ia64   
     29/** @addtogroup ia64
    3030 * @{
    3131 */
     
    3636#define KERN_ia64_ELF_H_
    3737
    38 #define ELF_MACHINE             EM_IA_64
    39 #define ELF_DATA_ENCODING       ELFDATA2LSB
    40 #define ELF_CLASS               ELFCLASS64
     38#define ELF_MACHINE        EM_IA_64
     39#define ELF_DATA_ENCODING  ELFDATA2LSB
     40#define ELF_CLASS          ELFCLASS64
    4141
    4242#endif
  • kernel/arch/ia64/include/istate.h

    r3666d386 rc0699467  
    3636#define KERN_ia64_ISTATE_H_
    3737
     38#include <trace.h>
     39
     40#ifdef KERNEL
     41
    3842#include <arch/register.h>
    3943
    40 #ifdef KERNEL
    41 #include <typedefs.h>
    42 #include <trace.h>
    43 #else
    44 #include <sys/types.h>
    45 #define NO_TRACE
    46 #endif
     44#else /* KERNEL */
     45
     46#include <libarch/register.h>
     47
     48#endif /* KERNEL */
    4749
    4850typedef struct istate {
  • kernel/arch/ia64/include/mm/frame.h

    r3666d386 rc0699467  
    3939#define FRAME_SIZE   (1 << FRAME_WIDTH)
    4040
    41 #ifdef KERNEL
    4241#ifndef __ASM__
    4342
     
    5049
    5150#endif /* __ASM__ */
    52 #endif /* KERNEL */
    5351
    5452#endif
  • kernel/arch/ia64/include/mm/page.h

    r3666d386 rc0699467  
    4141#define PAGE_SIZE   FRAME_SIZE
    4242#define PAGE_WIDTH  FRAME_WIDTH
    43 
    44 #ifdef KERNEL
    4543
    4644/** Bit width of the TLB-locked portion of kernel address space. */
     
    316314#endif /* __ASM__ */
    317315
    318 #endif /* KERNEL */
    319 
    320316#endif
    321317
  • kernel/arch/ia64/include/register.h

    r3666d386 rc0699467  
    6161#define PSR_CPL_MASK_SHIFTED  3
    6262
    63 #define PSR_RI_SHIFT    41
    64 #define PSR_RI_LEN      2
     63#define PSR_RI_SHIFT  41
     64#define PSR_RI_LEN    2
    6565
    6666#define PFM_MASK  (~0x3fffffffff)
     
    145145#ifndef __ASM__
    146146
    147 #ifdef KERNEL
    148 #include <typedefs.h>
    149 #else
    150 #include <sys/types.h>
    151 #endif
    152 
    153147/** Processor Status Register. */
    154148typedef union {
  • kernel/arch/ia64/src/ia64.c

    r3666d386 rc0699467  
    5050#include <userspace.h>
    5151#include <console/console.h>
    52 #include <proc/uarg.h>
     52#include <abi/proc/uarg.h>
    5353#include <syscall/syscall.h>
    5454#include <ddi/irq.h>
  • kernel/arch/mips32/include/context_offset.h

    r3666d386 rc0699467  
    6363#ifdef __ASM__
    6464
     65#ifdef KERNEL
     66
    6567#include <arch/asm/regname.h>
    6668
    67 # ctx: address of the structure with saved context
     69#else /* KERNEL */
     70
     71#include <libarch/regname.h>
     72
     73#endif /* KERNEL */
     74
     75/* ctx: address of the structure with saved context */
    6876.macro CONTEXT_SAVE_ARCH_CORE ctx:req
    69         sw $s0,OFFSET_S0(\ctx)
    70         sw $s1,OFFSET_S1(\ctx)
    71         sw $s2,OFFSET_S2(\ctx)
    72         sw $s3,OFFSET_S3(\ctx)
    73         sw $s4,OFFSET_S4(\ctx)
    74         sw $s5,OFFSET_S5(\ctx)
    75         sw $s6,OFFSET_S6(\ctx)
    76         sw $s7,OFFSET_S7(\ctx)
    77         sw $s8,OFFSET_S8(\ctx)
    78         sw $gp,OFFSET_GP(\ctx)
    79 
     77        sw $s0, OFFSET_S0(\ctx)
     78        sw $s1, OFFSET_S1(\ctx)
     79        sw $s2, OFFSET_S2(\ctx)
     80        sw $s3, OFFSET_S3(\ctx)
     81        sw $s4, OFFSET_S4(\ctx)
     82        sw $s5, OFFSET_S5(\ctx)
     83        sw $s6, OFFSET_S6(\ctx)
     84        sw $s7, OFFSET_S7(\ctx)
     85        sw $s8, OFFSET_S8(\ctx)
     86        sw $gp, OFFSET_GP(\ctx)
     87       
    8088#ifndef KERNEL
    81         sw $k1,OFFSET_TLS(\ctx)
    82 
     89        sw $k1, OFFSET_TLS(\ctx)
     90       
    8391#ifdef CONFIG_FPU
    84         mfc1 $t0,$20
     92        mfc1 $t0, $20
    8593        sw $t0, OFFSET_F20(\ctx)
    86 
    87         mfc1 $t0,$21
     94       
     95        mfc1 $t0, $21
    8896        sw $t0, OFFSET_F21(\ctx)
    89 
    90         mfc1 $t0,$22
     97       
     98        mfc1 $t0, $22
    9199        sw $t0, OFFSET_F22(\ctx)
    92 
    93         mfc1 $t0,$23
     100       
     101        mfc1 $t0, $23
    94102        sw $t0, OFFSET_F23(\ctx)
    95 
    96         mfc1 $t0,$24
     103       
     104        mfc1 $t0, $24
    97105        sw $t0, OFFSET_F24(\ctx)
    98 
    99         mfc1 $t0,$25
     106       
     107        mfc1 $t0, $25
    100108        sw $t0, OFFSET_F25(\ctx)
    101 
    102         mfc1 $t0,$26
     109       
     110        mfc1 $t0, $26
    103111        sw $t0, OFFSET_F26(\ctx)
    104 
    105         mfc1 $t0,$27
     112       
     113        mfc1 $t0, $27
    106114        sw $t0, OFFSET_F27(\ctx)
    107 
    108         mfc1 $t0,$28
     115       
     116        mfc1 $t0, $28
    109117        sw $t0, OFFSET_F28(\ctx)
    110 
    111         mfc1 $t0,$29
     118       
     119        mfc1 $t0, $29
    112120        sw $t0, OFFSET_F29(\ctx)
    113121       
    114         mfc1 $t0,$30
     122        mfc1 $t0, $30
    115123        sw $t0, OFFSET_F30(\ctx)
    116124#endif /* CONFIG_FPU */
    117125#endif /* KERNEL */
    118 
    119         sw $ra,OFFSET_PC(\ctx)
    120         sw $sp,OFFSET_SP(\ctx)
     126       
     127        sw $ra, OFFSET_PC(\ctx)
     128        sw $sp, OFFSET_SP(\ctx)
    121129.endm
    122130
    123 # ctx: address of the structure with saved context
     131/* ctx: address of the structure with saved context */
    124132.macro CONTEXT_RESTORE_ARCH_CORE ctx:req
    125         lw $s0,OFFSET_S0(\ctx)
    126         lw $s1,OFFSET_S1(\ctx)
    127         lw $s2,OFFSET_S2(\ctx)
    128         lw $s3,OFFSET_S3(\ctx)
    129         lw $s4,OFFSET_S4(\ctx)
    130         lw $s5,OFFSET_S5(\ctx)
    131         lw $s6,OFFSET_S6(\ctx)
    132         lw $s7,OFFSET_S7(\ctx)
    133         lw $s8,OFFSET_S8(\ctx)
    134         lw $gp,OFFSET_GP(\ctx)
     133        lw $s0, OFFSET_S0(\ctx)
     134        lw $s1, OFFSET_S1(\ctx)
     135        lw $s2, OFFSET_S2(\ctx)
     136        lw $s3, OFFSET_S3(\ctx)
     137        lw $s4, OFFSET_S4(\ctx)
     138        lw $s5, OFFSET_S5(\ctx)
     139        lw $s6, OFFSET_S6(\ctx)
     140        lw $s7, OFFSET_S7(\ctx)
     141        lw $s8, OFFSET_S8(\ctx)
     142        lw $gp, OFFSET_GP(\ctx)
    135143#ifndef KERNEL
    136         lw $k1,OFFSET_TLS(\ctx)
    137 
     144        lw $k1, OFFSET_TLS(\ctx)
     145       
    138146#ifdef CONFIG_FPU
    139147        lw $t0, OFFSET_F20(\ctx)
    140         mtc1 $t0,$20
    141 
     148        mtc1 $t0, $20
     149       
    142150        lw $t0, OFFSET_F21(\ctx)
    143         mtc1 $t0,$21
    144 
     151        mtc1 $t0, $21
     152       
    145153        lw $t0, OFFSET_F22(\ctx)
    146         mtc1 $t0,$22
    147 
     154        mtc1 $t0, $22
     155       
    148156        lw $t0, OFFSET_F23(\ctx)
    149         mtc1 $t0,$23
    150 
     157        mtc1 $t0, $23
     158       
    151159        lw $t0, OFFSET_F24(\ctx)
    152         mtc1 $t0,$24
    153 
     160        mtc1 $t0, $24
     161       
    154162        lw $t0, OFFSET_F25(\ctx)
    155         mtc1 $t0,$25
    156 
     163        mtc1 $t0, $25
     164       
    157165        lw $t0, OFFSET_F26(\ctx)
    158         mtc1 $t0,$26
    159 
     166        mtc1 $t0, $26
     167       
    160168        lw $t0, OFFSET_F27(\ctx)
    161         mtc1 $t0,$27
    162 
     169        mtc1 $t0, $27
     170       
    163171        lw $t0, OFFSET_F28(\ctx)
    164         mtc1 $t0,$28
    165 
     172        mtc1 $t0, $28
     173       
    166174        lw $t0, OFFSET_F29(\ctx)
    167         mtc1 $t0,$29
    168 
     175        mtc1 $t0, $29
     176       
    169177        lw $t0, OFFSET_F30(\ctx)
    170         mtc1 $t0,$30
     178        mtc1 $t0, $30
    171179#endif /* CONFIG_FPU */
    172180#endif /* KERNEL */
    173 
    174         lw $ra,OFFSET_PC(\ctx)
    175         lw $sp,OFFSET_SP(\ctx)
     181       
     182        lw $ra, OFFSET_PC(\ctx)
     183        lw $sp, OFFSET_SP(\ctx)
    176184.endm
    177185
    178 #endif
    179 
     186#endif /* __ASM__ */
    180187
    181188#endif
  • kernel/arch/mips32/include/cp0.h

    r3666d386 rc0699467  
    3636#define KERN_mips32_CP0_H_
    3737
    38 #ifdef KERNEL
    39 #include <typedefs.h>
    40 #else
    41 #include <sys/types.h>
    42 #endif
    43 
    4438#define cp0_status_ie_enabled_bit     (1 << 0)
    4539#define cp0_status_exl_exception_bit  (1 << 1)
     
    4943#define cp0_status_fpu_bit            (1 << 29)
    5044
    51 #define cp0_status_im_shift             8
    52 #define cp0_status_im_mask              0xff00
     45#define cp0_status_im_shift  8
     46#define cp0_status_im_mask   0xff00
    5347
    54 #define cp0_cause_excno(cause) ((cause >> 2) & 0x1f)
    55 #define cp0_cause_coperr(cause) ((cause >> 28) & 0x3)
     48#define cp0_cause_excno(cause)   ((cause >> 2) & 0x1f)
     49#define cp0_cause_coperr(cause)  ((cause >> 28) & 0x3)
    5650
    57 #define fpu_cop_id 1
     51#define fpu_cop_id  1
    5852
    5953/*
    6054 * Magic value for use in msim.
    6155 */
    62 #define cp0_compare_value               100000
     56#define cp0_compare_value  100000
    6357
    64 #define cp0_mask_all_int() cp0_status_write(cp0_status_read() & ~(cp0_status_im_mask))
    65 #define cp0_unmask_all_int() cp0_status_write(cp0_status_read() | cp0_status_im_mask)
    66 #define cp0_mask_int(it) cp0_status_write(cp0_status_read() & ~(1 << (cp0_status_im_shift + (it))))
    67 #define cp0_unmask_int(it) cp0_status_write(cp0_status_read() | (1 << (cp0_status_im_shift + (it))))
     58#define cp0_mask_all_int() \
     59        cp0_status_write(cp0_status_read() & ~(cp0_status_im_mask))
    6860
    69 #define GEN_READ_CP0(nm,reg) static inline uint32_t cp0_ ##nm##_read(void) \
    70   { \
    71       uint32_t retval; \
    72       asm volatile ("mfc0 %0, $" #reg : "=r"(retval)); \
    73       return retval; \
    74   }
     61#define cp0_unmask_all_int() \
     62        cp0_status_write(cp0_status_read() | cp0_status_im_mask)
    7563
    76 #define GEN_WRITE_CP0(nm,reg) static inline void cp0_ ##nm##_write(uint32_t val) \
    77  { \
    78     asm volatile ("mtc0 %0, $" #reg : : "r"(val) ); \
    79  }
     64#define cp0_mask_int(it) \
     65        cp0_status_write(cp0_status_read() & ~(1 << (cp0_status_im_shift + (it))))
     66
     67#define cp0_unmask_int(it) \
     68        cp0_status_write(cp0_status_read() | (1 << (cp0_status_im_shift + (it))))
     69
     70#define GEN_READ_CP0(nm, reg) \
     71        static inline uint32_t cp0_ ##nm##_read(void) \
     72        { \
     73                uint32_t retval; \
     74                \
     75                asm volatile ( \
     76                        "mfc0 %0, $" #reg \
     77                        : "=r"(retval) \
     78                ); \
     79                \
     80                return retval; \
     81        }
     82
     83#define GEN_WRITE_CP0(nm, reg) \
     84        static inline void cp0_ ##nm##_write(uint32_t val) \
     85        { \
     86                asm volatile ( \
     87                        "mtc0 %0, $" #reg \
     88                        :: "r"(val) \
     89                ); \
     90        }
    8091
    8192GEN_READ_CP0(index, 0);
  • kernel/arch/mips32/include/istate.h

    r3666d386 rc0699467  
    3636#define KERN_mips32_ISTATE_H_
    3737
     38#include <trace.h>
     39
     40#ifdef KERNEL
     41
    3842#include <arch/cp0.h>
    3943
    40 #ifdef KERNEL
    41 #include <typedefs.h>
    42 #include <trace.h>
    43 #else
    44 #include <sys/types.h>
    45 #define NO_TRACE
    46 #endif
     44#else /* KERNEL */
     45
     46#include <libarch/cp0.h>
     47
     48#endif /* KERNEL */
    4749
    4850typedef struct istate {
  • kernel/arch/mips32/include/mm/frame.h

    r3666d386 rc0699467  
    3939#define FRAME_SIZE   (1 << FRAME_WIDTH)
    4040
    41 #ifdef KERNEL
    4241#ifndef __ASM__
    4342
     
    4645
    4746#endif /* __ASM__ */
    48 #endif /* KERNEL */
    4947
    5048#endif
  • kernel/arch/mips32/include/mm/page.h

    r3666d386 rc0699467  
    4949#       define PA2KA(x) ((x) + 0x80000000)
    5050#endif
    51 
    52 #ifdef KERNEL
    5351
    5452/*
     
    188186#endif /* __ASM__ */
    189187
    190 #endif /* KERNEL */
    191 
    192188#endif
    193189
  • kernel/arch/mips32/src/mips32.c

    r3666d386 rc0699467  
    4141#include <memstr.h>
    4242#include <proc/thread.h>
    43 #include <proc/uarg.h>
     43#include <abi/proc/uarg.h>
    4444#include <print.h>
    4545#include <console/console.h>
     
    5252#include <arch/debugger.h>
    5353#include <genarch/fb/fb.h>
    54 #include <genarch/fb/visuals.h>
     54#include <abi/fb/visuals.h>
    5555#include <genarch/drivers/dsrln/dsrlnin.h>
    5656#include <genarch/drivers/dsrln/dsrlnout.h>
  • kernel/arch/mips64/include/context_offset.h

    r3666d386 rc0699467  
    6363#ifdef __ASM__
    6464
     65#ifdef KERNEL
     66
    6567#include <arch/asm/regname.h>
    6668
    67 # ctx: address of the structure with saved context
     69#else /* KERNEL */
     70
     71#include <libarch/regname.h>
     72
     73#endif /* KERNEL */
     74
     75/* ctx: address of the structure with saved context */
    6876.macro CONTEXT_SAVE_ARCH_CORE ctx:req
    6977        sd $s0, OFFSET_S0(\ctx)
     
    121129.endm
    122130
    123 # ctx: address of the structure with saved context
     131/* ctx: address of the structure with saved context */
    124132.macro CONTEXT_RESTORE_ARCH_CORE ctx:req
    125133        ld $s0, OFFSET_S0(\ctx)
  • kernel/arch/mips64/include/cp0.h

    r3666d386 rc0699467  
    3535#ifndef KERN_mips64_CP0_H_
    3636#define KERN_mips64_CP0_H_
    37 
    38 #ifdef KERNEL
    39 
    40 #include <typedefs.h>
    41 
    42 #else
    43 
    44 #include <sys/types.h>
    45 
    46 #endif
    4737
    4838#define cp0_status_ie_enabled_bit     (1 << 0)
  • kernel/arch/mips64/include/istate.h

    r3666d386 rc0699467  
    3636#define KERN_mips64_ISTATE_H_
    3737
    38 #include <arch/cp0.h>
     38#include <trace.h>
    3939
    4040#ifdef KERNEL
    4141
    42 #include <typedefs.h>
    43 #include <trace.h>
     42#include <arch/cp0.h>
    4443
    45 #else
     44#else /* KERNEL */
    4645
    47 #include <sys/types.h>
    48 #define NO_TRACE
     46#include <libarch/cp0.h>
    4947
    50 #endif
     48#endif /* KERNEL */
    5149
    5250typedef struct istate {
  • kernel/arch/mips64/include/mm/frame.h

    r3666d386 rc0699467  
    3939#define FRAME_SIZE   (1 << FRAME_WIDTH)
    4040
    41 #ifdef KERNEL
    4241#ifndef __ASM__
    4342
     
    4645
    4746#endif /* __ASM__ */
    48 #endif /* KERNEL */
    4947
    5048#endif
  • kernel/arch/mips64/include/mm/page.h

    r3666d386 rc0699467  
    5050#endif
    5151
    52 #ifdef KERNEL
    5352#ifndef __ASM__
    5453
     
    5655
    5756#endif /* __ASM__ */
    58 #endif /* KERNEL */
    5957
    6058#endif
  • kernel/arch/mips64/src/mips64.c

    r3666d386 rc0699467  
    4141#include <memstr.h>
    4242#include <proc/thread.h>
    43 #include <proc/uarg.h>
     43#include <abi/proc/uarg.h>
    4444#include <print.h>
    4545#include <console/console.h>
     
    5252#include <arch/debugger.h>
    5353#include <genarch/fb/fb.h>
    54 #include <genarch/fb/visuals.h>
     54#include <abi/fb/visuals.h>
    5555#include <genarch/drivers/dsrln/dsrlnin.h>
    5656#include <genarch/drivers/dsrln/dsrlnout.h>
  • kernel/arch/ppc32/include/asm.h

    r3666d386 rc0699467  
    3838#include <typedefs.h>
    3939#include <config.h>
    40 #include <arch/cpu.h>
     40#include <arch/msr.h>
    4141#include <arch/mm/asid.h>
    4242#include <trace.h>
  • kernel/arch/ppc32/include/context_offset.h

    r3666d386 rc0699467  
    7575
    7676#ifdef __ASM__
    77 # include <arch/asm/regname.h>
    7877
    79 # ctx: address of the structure with saved context
     78#ifdef KERNEL
     79
     80#include <arch/asm/regname.h>
     81
     82#else /* KERNEL */
     83
     84#include <libarch/regname.h>
     85
     86#endif /* KERNEL */
     87
     88/* ctx: address of the structure with saved context */
    8089.macro CONTEXT_SAVE_ARCH_CORE ctx:req
    8190        stw sp, OFFSET_SP(\ctx)
     
    102111.endm
    103112
    104 # ctx: address of the structure with saved context
     113/* ctx: address of the structure with saved context */
    105114.macro CONTEXT_RESTORE_ARCH_CORE ctx:req
    106115        lwz sp, OFFSET_SP(\ctx)
  • kernel/arch/ppc32/include/cpu.h

    r3666d386 rc0699467  
    3636#define KERN_ppc32_CPU_H_
    3737
    38 /* MSR bits */
    39 #define MSR_DR  (1 << 4)
    40 #define MSR_IR  (1 << 5)
    41 #define MSR_PR  (1 << 14)
    42 #define MSR_EE  (1 << 15)
    43 
    44 /* HID0 bits */
    45 #define HID0_STEN  (1 << 24)
    46 #define HID0_ICE   (1 << 15)
    47 #define HID0_DCE   (1 << 14)
    48 #define HID0_ICFI  (1 << 11)
    49 #define HID0_DCI   (1 << 10)
    50 
    51 #ifndef __ASM__
    52 
    5338#include <typedefs.h>
    5439#include <trace.h>
     
    6752}
    6853
    69 #endif /* __ASM__ */
    70 
    7154#endif
    7255
  • kernel/arch/ppc32/include/exception.h

    r3666d386 rc0699467  
    3737
    3838#include <typedefs.h>
    39 #include <arch/cpu.h>
     39#include <arch/msr.h>
    4040#include <trace.h>
    4141
  • kernel/arch/ppc32/include/istate.h

    r3666d386 rc0699467  
    3636#define KERN_ppc32_EXCEPTION_H_
    3737
    38 #include <typedefs.h>
    39 #include <arch/cpu.h>
    4038#include <trace.h>
     39
     40#ifdef KERNEL
     41
     42#include <arch/msr.h>
     43
     44#else /* KERNEL */
     45
     46#include <libarch/msr.h>
     47
     48#endif /* KERNEL */
    4149
    4250typedef struct istate {
  • kernel/arch/ppc32/include/mm/frame.h

    r3666d386 rc0699467  
    3939#define FRAME_SIZE   (1 << FRAME_WIDTH)
    4040
    41 #ifdef KERNEL
    4241#ifndef __ASM__
    4342
     
    6362
    6463#endif /* __ASM__ */
    65 #endif /* KERNEL */
    6664
    6765#endif
  • kernel/arch/ppc32/include/mm/page.h

    r3666d386 rc0699467  
    4141#define PAGE_WIDTH  FRAME_WIDTH
    4242#define PAGE_SIZE   FRAME_SIZE
    43 
    44 #ifdef KERNEL
    4543
    4644#ifndef __ASM__
     
    181179#endif /* __ASM__ */
    182180
    183 #endif /* KERNEL */
    184 
    185181#endif
    186182
  • kernel/arch/ppc32/include/msr.h

    r3666d386 rc0699467  
    11/*
    2  * Copyright (c) 2011 Jiri Svoboda
     2 * Copyright (c) 2005 Martin Decky
    33 * All rights reserved.
    44 *
     
    2727 */
    2828
    29 /** @addtogroup generic
     29/** @addtogroup ppc32
    3030 * @{
    3131 */
    3232/** @file
    33  *
    34  * This header allows including a kernel header using typedefs.h from
    35  * libc. User-space code should use sys/types.h directly.
    3633 */
    3734
    38 #ifndef LIBC_TYPEDEFS_H_
    39 #define LIBC_TYPEDEFS_H_
     35#ifndef KERN_ppc32_MSR_H_
     36#define KERN_ppc32_MSR_H_
    4037
    41 #include <sys/types.h>
     38/* MSR bits */
     39#define MSR_DR  (1 << 4)
     40#define MSR_IR  (1 << 5)
     41#define MSR_PR  (1 << 14)
     42#define MSR_EE  (1 << 15)
     43
     44/* HID0 bits */
     45#define HID0_STEN  (1 << 24)
     46#define HID0_ICE   (1 << 15)
     47#define HID0_DCE   (1 << 14)
     48#define HID0_ICFI  (1 << 11)
     49#define HID0_DCI   (1 << 10)
    4250
    4351#endif
  • kernel/arch/ppc32/src/asm.S

    r3666d386 rc0699467  
    2828
    2929#include <arch/asm/regname.h>
    30 #include <arch/cpu.h>
     30#include <arch/msr.h>
    3131
    3232.text
  • kernel/arch/ppc32/src/exception.S

    r3666d386 rc0699467  
    2828
    2929#include <arch/asm/regname.h>
    30 #include <arch/cpu.h>
     30#include <arch/msr.h>
    3131#include <arch/mm/page.h>
    3232
  • kernel/arch/ppc32/src/ppc32.c

    r3666d386 rc0699467  
    4141#include <interrupt.h>
    4242#include <genarch/fb/fb.h>
    43 #include <genarch/fb/visuals.h>
     43#include <abi/fb/visuals.h>
    4444#include <genarch/ofw/ofw_tree.h>
    4545#include <genarch/ofw/pci.h>
    4646#include <userspace.h>
    4747#include <mm/page.h>
    48 #include <proc/uarg.h>
     48#include <abi/proc/uarg.h>
    4949#include <console/console.h>
    5050#include <sysinfo/sysinfo.h>
  • kernel/arch/sparc64/include/barrier.h

    r3666d386 rc0699467  
    3737
    3838#include <trace.h>
    39 
    40 #ifdef KERNEL
    41 
    42 #include <typedefs.h>
    43 
    44 #else
    45 
    46 #include <stdint.h>
    47 
    48 #endif
    4939
    5040/*
  • kernel/arch/sparc64/include/elf.h

    r3666d386 rc0699467  
    2727 */
    2828
    29 /** @addtogroup sparc64 
     29/** @addtogroup sparc64
    3030 * @{
    3131 */
     
    3636#define KERN_sparc64_ELF_H_
    3737
    38 #define ELF_MACHINE             EM_SPARCV9
    39 #define ELF_DATA_ENCODING       ELFDATA2MSB
    40 #define ELF_CLASS               ELFCLASS64
     38#define ELF_MACHINE        EM_SPARCV9
     39#define ELF_DATA_ENCODING  ELFDATA2MSB
     40#define ELF_CLASS          ELFCLASS64
    4141
    4242#endif
  • kernel/arch/sparc64/include/istate.h

    r3666d386 rc0699467  
    3737#define KERN_sparc64_ISTATE_H_
    3838
     39#include <trace.h>
     40
     41#ifdef KERNEL
     42
    3943#include <arch/regdef.h>
    4044
    41 #ifdef KERNEL
    42 #include <typedefs.h>
    43 #include <trace.h>
    44 #else
    45 #include <sys/types.h>
    46 #define NO_TRACE
    47 #endif
     45#else /* KERNEL */
     46
     47#include <libarch/regdef.h>
     48
     49#endif /* KERNEL */
    4850
    4951typedef struct istate {
  • kernel/arch/sparc64/include/mm/page.h

    r3666d386 rc0699467  
    5454#define MMU_PAGES_PER_PAGE      (1 << (PAGE_WIDTH - MMU_PAGE_WIDTH))
    5555
    56 #ifdef KERNEL
    57 
    5856#ifndef __ASM__
    5957
     
    7775#endif /* !def __ASM__ */
    7876
    79 #endif /* KERNEL */
    80 
    8177#endif
    8278
  • kernel/arch/sparc64/include/mm/sun4u/frame.h

    r3666d386 rc0699467  
    5252#define FRAME_SIZE              (1 << FRAME_WIDTH)
    5353
    54 #ifdef KERNEL
    5554#ifndef __ASM__
    5655
     
    8079
    8180#endif
    82 #endif
    8381
    8482#endif
  • kernel/arch/sparc64/include/mm/sun4v/frame.h

    r3666d386 rc0699467  
    4242#define FRAME_SIZE              (1 << FRAME_WIDTH)
    4343
    44 #ifdef KERNEL
    4544#ifndef __ASM__
    4645
     
    5251
    5352#endif
    54 #endif
    5553
    5654#endif
  • kernel/arch/sparc64/include/mm/sun4v/page.h

    r3666d386 rc0699467  
    4646#define MMU_PAGES_PER_PAGE      (1 << (PAGE_WIDTH - MMU_PAGE_WIDTH))
    4747
    48 #ifdef KERNEL
    49 
    5048#ifndef __ASM__
    5149
     
    6967#endif /* !def __ASM__ */
    7068
    71 #endif /* KERNEL */
    72 
    7369#endif
    7470
  • kernel/arch/sparc64/include/sun4v/regdef.h

    r3666d386 rc0699467  
    2828 */
    2929
    30 /** @addtogroup sparc64 
     30/** @addtogroup sparc64
    3131 * @{
    3232 */
     
    3737#define KERN_sparc64_sun4v_REGDEF_H_
    3838
    39 #define PSTATE_IE_BIT   (1 << 1)
    40 #define PSTATE_PRIV_BIT (1 << 2)
    41 #define PSTATE_PEF_BIT  (1 << 4)
     39#define TSTATE_CWP_MASK  0x1f
    4240
    43 #define TSTATE_PSTATE_SHIFT     8
    44 #define TSTATE_PRIV_BIT         (PSTATE_PRIV_BIT << TSTATE_PSTATE_SHIFT)
    45 #define TSTATE_CWP_MASK         0x1f
    46 #define TSTATE_IE_BIT           (PSTATE_IE_BIT << TSTATE_PSTATE_SHIFT)
    47 
    48 #define WSTATE_NORMAL(n)        (n)
    49 #define WSTATE_OTHER(n)         ((n) << 3)
    50 
    51 #define TSTATE_PEF_BIT          (PSTATE_PEF_BIT << TSTATE_PSTATE_SHIFT)
     41#define WSTATE_NORMAL(n)  (n)
     42#define WSTATE_OTHER(n)   ((n) << 3)
    5243
    5344#endif
  • kernel/arch/sparc64/src/drivers/scr.c

    r3666d386 rc0699467  
    3939#include <genarch/ofw/upa.h>
    4040#include <genarch/fb/fb.h>
    41 #include <genarch/fb/visuals.h>
     41#include <abi/fb/visuals.h>
    4242#include <console/chardev.h>
    4343#include <console/console.h>
  • kernel/arch/sparc64/src/smp/sun4u/smp.c

    r3666d386 rc0699467  
    4242#include <macros.h>
    4343#include <typedefs.h>
    44 #include <synch/synch.h>
    4544#include <synch/waitq.h>
    4645#include <print.h>
  • kernel/arch/sparc64/src/smp/sun4v/smp.c

    r3666d386 rc0699467  
    4545#include <func.h>
    4646#include <typedefs.h>
    47 #include <synch/synch.h>
    4847#include <synch/waitq.h>
    4948#include <print.h>
  • kernel/arch/sparc64/src/sun4v/start.S

    r3666d386 rc0699467  
    3030#include <arch/arch.h>
    3131#include <arch/stack.h>
     32#include <arch/regdef.h>
    3233#include <arch/context_offset.h>
    3334#include <arch/sun4v/regdef.h>
Note: See TracChangeset for help on using the changeset viewer.