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


Ignore:
Timestamp:
2007-01-28T13:25:49Z (18 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/amd64/include
Files:
10 edited

Legend:

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

    r1ba41c5 rb3f8fb7  
    3636#define KERN_amd64_ASM_H_
    3737
    38 #include <arch/pm.h>
    39 #include <arch/types.h>
    4038#include <config.h>
    4139
  • kernel/arch/amd64/include/atomic.h

    r1ba41c5 rb3f8fb7  
    3939#include <arch/barrier.h>
    4040#include <preemption.h>
    41 #include <typedefs.h>
    4241
    4342static inline void atomic_inc(atomic_t *val) {
  • kernel/arch/amd64/include/cpu.h

    r1ba41c5 rb3f8fb7  
    5555#ifndef __ASM__
    5656
    57 #include <typedefs.h>
    5857#include <arch/pm.h>
    5958
  • kernel/arch/amd64/include/interrupt.h

    r1ba41c5 rb3f8fb7  
    7070
    7171/** This is passed to interrupt handlers */
    72 struct istate {
     72typedef struct {
    7373        uint64_t rax;
    7474        uint64_t rbx;
     
    9191        uint64_t rflags;
    9292        uint64_t stack[]; /* Additional data on stack */
    93 };
     93} istate_t;
    9494
    9595/** Return true if exception happened while in userspace */
  • kernel/arch/amd64/include/mm/as.h

    r1ba41c5 rb3f8fb7  
    4545#define USTACK_ADDRESS_ARCH     (USER_ADDRESS_SPACE_END_ARCH-(PAGE_SIZE-1))
    4646
    47 typedef struct {
    48 } as_arch_t;
    49 
    5047#define as_constructor_arch(as, flags)          (as != as)
    5148#define as_destructor_arch(as)                  (as != as)
     
    5552#define as_invalidate_translation_cache(as, page, cnt)
    5653
     54typedef struct {
     55} as_arch_t;
     56
     57#include <genarch/mm/as_pt.h>
     58
    5759extern void as_arch_init(void);
    5860
  • kernel/arch/amd64/include/mm/page.h

    r1ba41c5 rb3f8fb7  
    5858
    5959#ifndef __ASM__
    60 #  include <mm/page.h>
    61 #  include <arch/types.h>
    62 #endif
     60#       include <mm/mm.h>
     61#       include <arch/types.h>
     62#       include <arch/interrupt.h>
    6363
    64 #ifndef __ASM__
    6564static inline uintptr_t ka2pa(uintptr_t x)
    6665{
     
    7069                return x - 0xffff800000000000;
    7170}
    72 # define KA2PA(x)      ka2pa((uintptr_t)x)
    73 # define PA2KA_CODE(x)      (((uintptr_t) (x)) + 0xffffffff80000000)
    74 # define PA2KA(x)      (((uintptr_t) (x)) + 0xffff800000000000)
     71
     72#       define KA2PA(x)      ka2pa((uintptr_t)x)
     73#       define PA2KA_CODE(x)      (((uintptr_t) (x)) + 0xffffffff80000000)
     74#       define PA2KA(x)      (((uintptr_t) (x)) + 0xffff800000000000)
    7575#else
    76 # define KA2PA(x)      ((x) - 0xffffffff80000000)
    77 # define PA2KA(x)      ((x) + 0xffffffff80000000)
     76#       define KA2PA(x)      ((x) - 0xffffffff80000000)
     77#       define PA2KA(x)      ((x) + 0xffffffff80000000)
    7878#endif
    7979
     
    134134#define PFERR_CODE_ID           (1<<4)
    135135
    136 /** Page Table Entry. */
    137 struct page_specifier {
    138         unsigned present : 1;
    139         unsigned writeable : 1;
    140         unsigned uaccessible : 1;
    141         unsigned page_write_through : 1;
    142         unsigned page_cache_disable : 1;
    143         unsigned accessed : 1;
    144         unsigned dirty : 1;
    145         unsigned unused: 1;
    146         unsigned global : 1;
    147         unsigned soft_valid : 1;                /**< Valid content even if present bit is cleared. */
    148         unsigned avl : 2;
    149         unsigned addr_12_31 : 30;
    150         unsigned addr_32_51 : 21;
    151         unsigned no_execute : 1;
    152 } __attribute__ ((packed));
    153 
    154136static inline int get_pt_flags(pte_t *pt, index_t i)
    155137{
  • kernel/arch/amd64/include/pm.h

    r1ba41c5 rb3f8fb7  
    3737
    3838#ifndef __ASM__
    39 # include <arch/types.h>
    40 # include <typedefs.h>
    41 # include <arch/context.h>
     39#       include <arch/types.h>
     40#       include <arch/context.h>
    4241#endif
    4342
  • kernel/arch/amd64/include/proc/task.h

    r1ba41c5 rb3f8fb7  
    3636#define KERN_amd64_TASK_H_
    3737
    38 #include <typedefs.h>
    3938#include <arch/types.h>
    4039#include <adt/bitmap.h>
  • kernel/arch/amd64/include/proc/thread.h

    r1ba41c5 rb3f8fb7  
    3636#define KERN_amd64_THREAD_H_
    3737
    38 #include <arch/types.h>
    39 
    4038typedef struct {
    4139        unative_t tls;
  • kernel/arch/amd64/include/types.h

    r1ba41c5 rb3f8fb7  
    3737
    3838#define NULL 0
     39#define false 0
     40#define true 1
    3941
    4042typedef signed char int8_t;
     
    4850typedef unsigned long long uint64_t;
    4951
     52typedef uint64_t size_t;
     53typedef uint64_t count_t;
     54typedef uint64_t index_t;
     55
    5056typedef uint64_t uintptr_t;
    5157typedef uint64_t pfn_t;
    5258
    53 /* Flags of processor (return value of interrupts_disable()) */
    5459typedef uint64_t ipl_t;
    5560
     
    5762typedef int64_t native_t;
    5863
    59 typedef struct page_specifier pte_t;
     64typedef uint8_t bool;
     65typedef uint64_t task_id_t;
     66typedef uint32_t context_id_t;
     67
     68typedef int32_t inr_t;
     69typedef int32_t devno_t;
     70
     71/** Page Table Entry. */
     72typedef struct {
     73        unsigned present : 1;
     74        unsigned writeable : 1;
     75        unsigned uaccessible : 1;
     76        unsigned page_write_through : 1;
     77        unsigned page_cache_disable : 1;
     78        unsigned accessed : 1;
     79        unsigned dirty : 1;
     80        unsigned unused: 1;
     81        unsigned global : 1;
     82        unsigned soft_valid : 1;                /**< Valid content even if present bit is cleared. */
     83        unsigned avl : 2;
     84        unsigned addr_12_31 : 30;
     85        unsigned addr_32_51 : 21;
     86        unsigned no_execute : 1;
     87} __attribute__ ((packed)) pte_t;
    6088
    6189#endif
Note: See TracChangeset for help on using the changeset viewer.