Changeset b3f8fb7 in mainline for kernel/arch/mips32/include


Ignore:
Timestamp:
2007-01-28T13:25:49Z (19 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
8e8c1a5
Parents:
1ba41c5
Message:

huge type system cleanup
remove cyclical type dependencies across multiple header files
many minor coding style fixes

Location:
kernel/arch/mips32/include
Files:
12 edited

Legend:

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

    r1ba41c5 rb3f8fb7  
    3737
    3838#include <arch/types.h>
    39 #include <typedefs.h>
    4039#include <config.h>
    4140
  • kernel/arch/mips32/include/cache.h

    r1ba41c5 rb3f8fb7  
    3636#define KERN_mips32_CACHE_H_
    3737
    38 #include <typedefs.h>
     38#include <arch/exception.h>
    3939
    4040extern void cache_error(istate_t *istate);
  • kernel/arch/mips32/include/context_offset.h

    r1ba41c5 rb3f8fb7  
    4343#define OFFSET_GP      0x2c
    4444
    45 /* struct istate */
     45/* istate_t */
    4646#define EOFFSET_AT     0x0
    4747#define EOFFSET_V0     0x4
  • kernel/arch/mips32/include/cp0.h

    r1ba41c5 rb3f8fb7  
    3737
    3838#include <arch/types.h>
    39 #include <arch/mm/tlb.h>
    4039
    41 #define cp0_status_ie_enabled_bit       (1<<0)
    42 #define cp0_status_exl_exception_bit    (1<<1)
    43 #define cp0_status_erl_error_bit        (1<<2)
    44 #define cp0_status_um_bit               (1<<4)
    45 #define cp0_status_bev_bootstrap_bit    (1<<22)
    46 #define cp0_status_fpu_bit              (1<<29)
     40#define cp0_status_ie_enabled_bit       (1 << 0)
     41#define cp0_status_exl_exception_bit    (1 << 1)
     42#define cp0_status_erl_error_bit        (1 << 2)
     43#define cp0_status_um_bit               (1 << 4)
     44#define cp0_status_bev_bootstrap_bit    (1 << 22)
     45#define cp0_status_fpu_bit              (1 << 29)
    4746
    4847#define cp0_status_im_shift             8
     
    6160#define cp0_mask_all_int() cp0_status_write(cp0_status_read() & ~(cp0_status_im_mask))
    6261#define cp0_unmask_all_int() cp0_status_write(cp0_status_read() | cp0_status_im_mask)
    63 #define cp0_mask_int(it) cp0_status_write(cp0_status_read() & ~(1<<(cp0_status_im_shift+(it))))
    64 #define cp0_unmask_int(it) cp0_status_write(cp0_status_read() | (1<<(cp0_status_im_shift+(it))))
     62#define cp0_mask_int(it) cp0_status_write(cp0_status_read() & ~(1 << (cp0_status_im_shift + (it))))
     63#define cp0_unmask_int(it) cp0_status_write(cp0_status_read() | (1 << (cp0_status_im_shift + (it))))
    6564
    6665#define GEN_READ_CP0(nm,reg) static inline uint32_t cp0_ ##nm##_read(void) \
  • kernel/arch/mips32/include/cpu.h

    r1ba41c5 rb3f8fb7  
    3737
    3838#include <arch/types.h>
     39#include <arch/asm.h>
    3940
    4041typedef struct {
  • kernel/arch/mips32/include/debugger.h

    r1ba41c5 rb3f8fb7  
    3636#define KERN_mips32_DEBUGGER_H_
    3737
    38 #include <typedefs.h>
    3938#include <arch/exception.h>
    4039#include <arch/types.h>
  • kernel/arch/mips32/include/exception.h

    r1ba41c5 rb3f8fb7  
    3737
    3838#include <arch/types.h>
    39 #include <typedefs.h>
    4039#include <arch/cp0.h>
    4140
     
    5958#define EXC_VCED        31
    6059
    61 struct istate {
     60typedef struct {
    6261        uint32_t at;
    6362        uint32_t v0;
     
    9695        uint32_t epc; /* cp0_epc */
    9796        uint32_t k1; /* We use it as thread-local pointer */
    98 };
     97} istate_t;
    9998
    10099static inline void istate_set_retaddr(istate_t *istate, uintptr_t retaddr)
  • kernel/arch/mips32/include/interrupt.h

    r1ba41c5 rb3f8fb7  
    3636#define KERN_mips32_INTERRUPT_H_
    3737
     38#include <typedefs.h>
    3839#include <arch/exception.h>
    3940
  • kernel/arch/mips32/include/mm/as.h

    r1ba41c5 rb3f8fb7  
    4343#define USER_ADDRESS_SPACE_END_ARCH             (unsigned long) 0x7fffffff
    4444
    45 #define USTACK_ADDRESS_ARCH     (0x80000000-PAGE_SIZE)
     45#define USTACK_ADDRESS_ARCH     (0x80000000 - PAGE_SIZE)
    4646
    4747typedef struct {
    4848} as_arch_t;
     49
     50#include <genarch/mm/as_pt.h>
    4951
    5052#define as_constructor_arch(as, flags)          (as != as)
  • kernel/arch/mips32/include/mm/page.h

    r1ba41c5 rb3f8fb7  
    4444
    4545#ifndef __ASM__
    46 #  define KA2PA(x)      (((uintptr_t) (x)) - 0x80000000)
    47 #  define PA2KA(x)      (((uintptr_t) (x)) + 0x80000000)
     46#       define KA2PA(x) (((uintptr_t) (x)) - 0x80000000)
     47#       define PA2KA(x) (((uintptr_t) (x)) + 0x80000000)
    4848#else
    49 #  define KA2PA(x)      ((x) - 0x80000000)
    50 #  define PA2KA(x)      ((x) + 0x80000000)
     49#       define KA2PA(x) ((x) - 0x80000000)
     50#       define PA2KA(x) ((x) + 0x80000000)
    5151#endif
    5252
     
    110110#ifndef __ASM__
    111111
    112 #include <arch/mm/tlb.h>
    113 #include <mm/page.h>
    114 #include <arch/mm/frame.h>
    115 #include <arch/types.h>
     112#include <mm/mm.h>
     113#include <arch/exception.h>
    116114
    117115static inline int get_pt_flags(pte_t *pt, index_t i)
  • kernel/arch/mips32/include/mm/tlb.h

    r1ba41c5 rb3f8fb7  
    3737
    3838#include <arch/exception.h>
    39 #include <typedefs.h>
    4039
    4140#ifdef TLBCNT
     
    5352#define PAGE_CACHEABLE_EXC_WRITE        5
    5453
    55 typedef union entry_lo entry_lo_t;
    56 typedef union entry_hi entry_hi_t;
    57 typedef union page_mask page_mask_t;
    58 typedef union index tlb_index_t;
    59 
    60 union entry_lo {
     54typedef union {
    6155        struct {
    6256#ifdef BIG_ENDIAN
     
    7771        } __attribute__ ((packed));
    7872        uint32_t value;
    79 };
     73} entry_lo_t;
    8074
    81 /** Page Table Entry. */
    82 struct pte {
    83         unsigned g : 1;                 /**< Global bit. */
    84         unsigned p : 1;                 /**< Present bit. */
    85         unsigned d : 1;                 /**< Dirty bit. */
    86         unsigned cacheable : 1;         /**< Cacheable bit. */
    87         unsigned : 1;                   /**< Unused. */
    88         unsigned soft_valid : 1;        /**< Valid content even if not present. */
    89         unsigned pfn : 24;              /**< Physical frame number. */
    90         unsigned w : 1;                 /**< Page writable bit. */
    91         unsigned a : 1;                 /**< Accessed bit. */
    92 };
    93 
    94 union entry_hi {
     75typedef union {
    9576        struct {
    9677#ifdef BIG_ENDIAN
     
    10586        } __attribute__ ((packed));
    10687        uint32_t value;
    107 };
     88} entry_hi_t;
    10889
    109 union page_mask {
     90typedef union {
    11091        struct {
    11192#ifdef BIG_ENDIAN
     
    120101        } __attribute__ ((packed));
    121102        uint32_t value;
    122 };
     103} page_mask_t;
    123104
    124 union index {
     105typedef union {
    125106        struct {
    126107#ifdef BIG_ENDIAN
     
    135116        } __attribute__ ((packed));
    136117        uint32_t value;
    137 };
     118} tlb_index_t;
    138119
    139120/** Probe TLB for Matching Entry
  • kernel/arch/mips32/include/types.h

    r1ba41c5 rb3f8fb7  
    3636#define KERN_mips32_TYPES_H_
    3737
    38 #define NULL    0
     38#define NULL 0
     39#define false 0
     40#define true 1
    3941
    4042typedef signed char int8_t;
    41 typedef unsigned char uint8_t;
    42 
    4343typedef signed short int16_t;
    44 typedef unsigned short uint16_t;
    45 
    46 typedef unsigned long uint32_t;
    4744typedef signed long int32_t;
    48 
    49 typedef unsigned long long uint64_t;
    5045typedef signed long long int64_t;
    5146
     47typedef unsigned char uint8_t;
     48typedef unsigned short uint16_t;
     49typedef unsigned long uint32_t;
     50typedef unsigned long long uint64_t;
     51
     52typedef uint32_t size_t;
     53typedef uint32_t count_t;
     54typedef uint32_t index_t;
     55
    5256typedef uint32_t uintptr_t;
     57typedef uint32_t pfn_t;
    5358
    5459typedef uint32_t ipl_t;
     
    5762typedef int32_t native_t;
    5863
    59 typedef struct pte pte_t;
     64typedef uint8_t bool;
     65typedef uint64_t task_id_t;
     66typedef uint32_t context_id_t;
    6067
    61 typedef uint32_t pfn_t;
     68typedef int32_t inr_t;
     69typedef int32_t devno_t;
     70
     71/** Page Table Entry. */
     72typedef struct {
     73        unsigned g : 1;                 /**< Global bit. */
     74        unsigned p : 1;                 /**< Present bit. */
     75        unsigned d : 1;                 /**< Dirty bit. */
     76        unsigned cacheable : 1;         /**< Cacheable bit. */
     77        unsigned : 1;                   /**< Unused. */
     78        unsigned soft_valid : 1;        /**< Valid content even if not present. */
     79        unsigned pfn : 24;              /**< Physical frame number. */
     80        unsigned w : 1;                 /**< Page writable bit. */
     81        unsigned a : 1;                 /**< Accessed bit. */
     82} pte_t;
    6283
    6384#endif
Note: See TracChangeset for help on using the changeset viewer.