Changeset 7a0359b in mainline for kernel/arch/abs32le/include


Ignore:
Timestamp:
2010-07-02T15:42:19Z (16 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
bbfdf62
Parents:
e3ee9b9
Message:

improve kernel function tracing

  • add support for more generic kernel sources
  • replace attribute((no_instrument_function)) with NO_TRACE macro (shorter and for future compatibility with different compilers)
  • to be on the safe side, do not instrument most of the inline and static functions (plus some specific non-static functions)

collateral code cleanup (no change in functionality)

Location:
kernel/arch/abs32le/include
Files:
5 edited

Legend:

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

    re3ee9b9 r7a0359b  
    3838#include <typedefs.h>
    3939#include <config.h>
    40 
    41 static inline void asm_delay_loop(uint32_t usec)
    42 {
    43 }
    44 
    45 static inline __attribute__((noreturn)) void cpu_halt(void)
     40#include <trace.h>
     41
     42NO_TRACE static inline void asm_delay_loop(uint32_t usec)
     43{
     44}
     45
     46NO_TRACE static inline __attribute__((noreturn)) void cpu_halt(void)
    4647{
    4748        /* On real hardware this should stop processing further
     
    5354}
    5455
    55 static inline void cpu_sleep(void)
     56NO_TRACE static inline void cpu_sleep(void)
    5657{
    5758        /* On real hardware this should put the CPU into low-power
     
    6162}
    6263
    63 static inline void pio_write_8(ioport8_t *port, uint8_t val)
     64NO_TRACE static inline void pio_write_8(ioport8_t *port, uint8_t val)
    6465{
    6566}
     
    7374 *
    7475 */
    75 static inline void pio_write_16(ioport16_t *port, uint16_t val)
     76NO_TRACE static inline void pio_write_16(ioport16_t *port, uint16_t val)
    7677{
    7778}
     
    8586 *
    8687 */
    87 static inline void pio_write_32(ioport32_t *port, uint32_t val)
     88NO_TRACE static inline void pio_write_32(ioport32_t *port, uint32_t val)
    8889{
    8990}
     
    9798 *
    9899 */
    99 static inline uint8_t pio_read_8(ioport8_t *port)
     100NO_TRACE static inline uint8_t pio_read_8(ioport8_t *port)
    100101{
    101102        return 0;
     
    110111 *
    111112 */
    112 static inline uint16_t pio_read_16(ioport16_t *port)
     113NO_TRACE static inline uint16_t pio_read_16(ioport16_t *port)
    113114{
    114115        return 0;
     
    123124 *
    124125 */
    125 static inline uint32_t pio_read_32(ioport32_t *port)
    126 {
    127         return 0;
    128 }
    129 
    130 static inline ipl_t interrupts_enable(void)
    131 {
    132         /* On real hardware this unconditionally enables preemption
    133            by internal and external interrupts.
    134            
    135            The return value stores the previous interrupt level. */
    136        
    137         return 0;
    138 }
    139 
    140 static inline ipl_t interrupts_disable(void)
    141 {
    142         /* On real hardware this disables preemption by the usual
    143            set of internal and external interrupts. This does not
    144            apply to special non-maskable interrupts and sychronous
    145            CPU exceptions.
    146            
    147            The return value stores the previous interrupt level. */
    148        
    149         return 0;
    150 }
    151 
    152 static inline void interrupts_restore(ipl_t ipl)
    153 {
    154         /* On real hardware this either enables or disables preemption
    155            according to the interrupt level value from the argument. */
    156 }
    157 
    158 static inline ipl_t interrupts_read(void)
    159 {
    160         /* On real hardware the return value stores the current interrupt
    161            level. */
    162        
    163         return 0;
    164 }
    165 
    166 static inline bool interrupts_disabled(void)
    167 {
    168         /* On real hardware the return value is true iff interrupts are
    169            disabled. */
     126NO_TRACE static inline uint32_t pio_read_32(ioport32_t *port)
     127{
     128        return 0;
     129}
     130
     131NO_TRACE static inline ipl_t interrupts_enable(void)
     132{
     133        /*
     134         * On real hardware this unconditionally enables preemption
     135         * by internal and external interrupts.
     136         *
     137         * The return value stores the previous interrupt level.
     138         */
     139       
     140        return 0;
     141}
     142
     143NO_TRACE static inline ipl_t interrupts_disable(void)
     144{
     145        /*
     146         * On real hardware this disables preemption by the usual
     147         * set of internal and external interrupts. This does not
     148         * apply to special non-maskable interrupts and sychronous
     149         * CPU exceptions.
     150         *
     151         * The return value stores the previous interrupt level.
     152         */
     153       
     154        return 0;
     155}
     156
     157NO_TRACE static inline void interrupts_restore(ipl_t ipl)
     158{
     159        /*
     160         * On real hardware this either enables or disables preemption
     161         * according to the interrupt level value from the argument.
     162         */
     163}
     164
     165NO_TRACE static inline ipl_t interrupts_read(void)
     166{
     167        /*
     168         * On real hardware the return value stores the current interrupt
     169         * level.
     170         */
     171       
     172        return 0;
     173}
     174
     175NO_TRACE static inline bool interrupts_disabled(void)
     176{
     177        /*
     178         * On real hardware the return value is true iff interrupts are
     179         * disabled.
     180         */
     181       
    170182        return false;
    171183}
    172184
    173 static inline uintptr_t get_stack_base(void)
    174 {
    175         /* On real hardware this returns the address of the bottom
    176            of the current CPU stack. The the_t structure is stored
    177            on the bottom of stack and this is used to identify the
    178            current CPU, current task, current thread and current
    179            address space. */
     185NO_TRACE static inline uintptr_t get_stack_base(void)
     186{
     187        /*
     188         * On real hardware this returns the address of the bottom
     189         * of the current CPU stack. The the_t structure is stored
     190         * on the bottom of stack and this is used to identify the
     191         * current CPU, current task, current thread and current
     192         * address space.
     193         */
    180194       
    181195        return 0;
  • kernel/arch/abs32le/include/atomic.h

    re3ee9b9 r7a0359b  
    4040#include <preemption.h>
    4141#include <verify.h>
     42#include <trace.h>
    4243
    43 ATOMIC static inline void atomic_inc(atomic_t *val)
     44NO_TRACE ATOMIC static inline void atomic_inc(atomic_t *val)
    4445    WRITES(&val->count)
    4546    REQUIRES_EXTENT_MUTABLE(val)
     
    5253}
    5354
    54 ATOMIC static inline void atomic_dec(atomic_t *val)
     55NO_TRACE ATOMIC static inline void atomic_dec(atomic_t *val)
    5556    WRITES(&val->count)
    5657    REQUIRES_EXTENT_MUTABLE(val)
     
    6364}
    6465
    65 ATOMIC static inline atomic_count_t atomic_postinc(atomic_t *val)
     66NO_TRACE ATOMIC static inline atomic_count_t atomic_postinc(atomic_t *val)
    6667    WRITES(&val->count)
    6768    REQUIRES_EXTENT_MUTABLE(val)
     
    7879}
    7980
    80 ATOMIC static inline atomic_count_t atomic_postdec(atomic_t *val)
     81NO_TRACE ATOMIC static inline atomic_count_t atomic_postdec(atomic_t *val)
    8182    WRITES(&val->count)
    8283    REQUIRES_EXTENT_MUTABLE(val)
     
    9697#define atomic_predec(val)  (atomic_postdec(val) - 1)
    9798
    98 ATOMIC static inline atomic_count_t test_and_set(atomic_t *val)
     99NO_TRACE ATOMIC static inline atomic_count_t test_and_set(atomic_t *val)
    99100    WRITES(&val->count)
    100101    REQUIRES_EXTENT_MUTABLE(val)
     
    109110}
    110111
    111 static inline void atomic_lock_arch(atomic_t *val)
     112NO_TRACE static inline void atomic_lock_arch(atomic_t *val)
    112113    WRITES(&val->count)
    113114    REQUIRES_EXTENT_MUTABLE(val)
  • kernel/arch/abs32le/include/cycle.h

    re3ee9b9 r7a0359b  
    3636#define KERN_abs32le_CYCLE_H_
    3737
    38 static inline uint64_t get_cycle(void)
     38#include <trace.h>
     39
     40NO_TRACE static inline uint64_t get_cycle(void)
    3941{
    4042        return 0;
  • kernel/arch/abs32le/include/interrupt.h

    re3ee9b9 r7a0359b  
    3838#include <typedefs.h>
    3939#include <verify.h>
     40#include <trace.h>
    4041
    4142#define IVT_ITEMS  0
     
    5455} istate_t;
    5556
    56 static inline int istate_from_uspace(istate_t *istate)
     57NO_TRACE static inline int istate_from_uspace(istate_t *istate)
    5758    REQUIRES_EXTENT_MUTABLE(istate)
    5859{
     
    6364}
    6465
    65 static inline void istate_set_retaddr(istate_t *istate, uintptr_t retaddr)
     66NO_TRACE static inline void istate_set_retaddr(istate_t *istate,
     67    uintptr_t retaddr)
    6668    WRITES(&istate->ip)
    6769{
     
    7173}
    7274
    73 static inline unative_t istate_get_pc(istate_t *istate)
     75NO_TRACE static inline unative_t istate_get_pc(istate_t *istate)
    7476    REQUIRES_EXTENT_MUTABLE(istate)
    7577{
     
    7981}
    8082
    81 static inline unative_t istate_get_fp(istate_t *istate)
     83NO_TRACE static inline unative_t istate_get_fp(istate_t *istate)
    8284    REQUIRES_EXTENT_MUTABLE(istate)
    8385{
  • kernel/arch/abs32le/include/mm/page.h

    re3ee9b9 r7a0359b  
    3737
    3838#include <arch/mm/frame.h>
     39#include <trace.h>
    3940
    4041#define PAGE_WIDTH  FRAME_WIDTH
     
    139140} __attribute__((packed)) pte_t;
    140141
    141 static inline unsigned int get_pt_flags(pte_t *pt, size_t i)
     142NO_TRACE static inline unsigned int get_pt_flags(pte_t *pt, size_t i)
    142143    REQUIRES_ARRAY_MUTABLE(pt, PTL0_ENTRIES_ARCH)
    143144{
     
    155156}
    156157
    157 static inline void set_pt_flags(pte_t *pt, size_t i, int flags)
     158NO_TRACE static inline void set_pt_flags(pte_t *pt, size_t i, int flags)
    158159    WRITES(ARRAY_RANGE(pt, PTL0_ENTRIES_ARCH))
    159160    REQUIRES_ARRAY_MUTABLE(pt, PTL0_ENTRIES_ARCH)
Note: See TracChangeset for help on using the changeset viewer.