Ignore:
File:
1 edited

Legend:

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

    r7a0359b rdbd5df1b  
    4040#include <typedefs.h>
    4141#include <arch/register.h>
    42 #include <trace.h>
    4342
    4443#define IA64_IOSPACE_ADDRESS  0xE001000000000000ULL
    4544
    46 NO_TRACE static inline void pio_write_8(ioport8_t *port, uint8_t v)
     45static inline void pio_write_8(ioport8_t *port, uint8_t v)
    4746{
    4847        uintptr_t prt = (uintptr_t) port;
     
    5756}
    5857
    59 NO_TRACE static inline void pio_write_16(ioport16_t *port, uint16_t v)
     58static inline void pio_write_16(ioport16_t *port, uint16_t v)
    6059{
    6160        uintptr_t prt = (uintptr_t) port;
     
    7069}
    7170
    72 NO_TRACE static inline void pio_write_32(ioport32_t *port, uint32_t v)
     71static inline void pio_write_32(ioport32_t *port, uint32_t v)
    7372{
    7473        uintptr_t prt = (uintptr_t) port;
     
    8382}
    8483
    85 NO_TRACE static inline uint8_t pio_read_8(ioport8_t *port)
     84static inline uint8_t pio_read_8(ioport8_t *port)
    8685{
    8786        uintptr_t prt = (uintptr_t) port;
     
    9695}
    9796
    98 NO_TRACE static inline uint16_t pio_read_16(ioport16_t *port)
     97static inline uint16_t pio_read_16(ioport16_t *port)
    9998{
    10099        uintptr_t prt = (uintptr_t) port;
     
    109108}
    110109
    111 NO_TRACE static inline uint32_t pio_read_32(ioport32_t *port)
     110static inline uint32_t pio_read_32(ioport32_t *port)
    112111{
    113112        uintptr_t prt = (uintptr_t) port;
     
    127126 * The stack is assumed to be STACK_SIZE long.
    128127 * The stack must start on page boundary.
    129  *
    130  */
    131 NO_TRACE static inline uintptr_t get_stack_base(void)
    132 {
    133         uint64_t v;
    134        
    135         /*
    136          * I'm not sure why but this code inlines badly
    137          * in scheduler, resulting in THE shifting about
    138          * 16B and causing kernel panic.
    139          *
    140          * asm volatile (
    141          *     "and %[value] = %[mask], r12"
    142          *     : [value] "=r" (v)
    143          *     : [mask] "r" (~(STACK_SIZE - 1))
    144          * );
    145          * return v;
    146          *
    147          * The following code has the same semantics but
    148          * inlines correctly.
    149          *
    150          */
     128 */
     129static inline uintptr_t get_stack_base(void)
     130{
     131        uint64_t v;
     132       
     133        /* I'm not sure why but this code bad inlines in scheduler,
     134           so THE shifts about 16B and causes kernel panic
     135           
     136           asm volatile (
     137               "and %[value] = %[mask], r12"
     138               : [value] "=r" (v)
     139               : [mask] "r" (~(STACK_SIZE - 1))
     140           );
     141           return v;
     142           
     143           This code have the same meaning but inlines well.
     144        */
    151145       
    152146        asm volatile (
     
    161155 *
    162156 * @return PSR.
    163  *
    164  */
    165 NO_TRACE static inline uint64_t psr_read(void)
     157 */
     158static inline uint64_t psr_read(void)
    166159{
    167160        uint64_t v;
     
    178171 *
    179172 * @return Return location of interruption vector table.
    180  *
    181  */
    182 NO_TRACE static inline uint64_t iva_read(void)
     173 */
     174static inline uint64_t iva_read(void)
    183175{
    184176        uint64_t v;
     
    195187 *
    196188 * @param v New location of interruption vector table.
    197  *
    198  */
    199 NO_TRACE static inline void iva_write(uint64_t v)
     189 */
     190static inline void iva_write(uint64_t v)
    200191{
    201192        asm volatile (
     
    205196}
    206197
     198
    207199/** Read IVR (External Interrupt Vector Register).
    208200 *
    209  * @return Highest priority, pending, unmasked external
    210  *         interrupt vector.
    211  *
    212  */
    213 NO_TRACE static inline uint64_t ivr_read(void)
     201 * @return Highest priority, pending, unmasked external interrupt vector.
     202 */
     203static inline uint64_t ivr_read(void)
    214204{
    215205        uint64_t v;
     
    223213}
    224214
    225 NO_TRACE static inline uint64_t cr64_read(void)
     215static inline uint64_t cr64_read(void)
    226216{
    227217        uint64_t v;
     
    235225}
    236226
     227
    237228/** Write ITC (Interval Timer Counter) register.
    238229 *
    239230 * @param v New counter value.
    240  *
    241  */
    242 NO_TRACE static inline void itc_write(uint64_t v)
     231 */
     232static inline void itc_write(uint64_t v)
    243233{
    244234        asm volatile (
     
    251241 *
    252242 * @return Current counter value.
    253  *
    254  */
    255 NO_TRACE static inline uint64_t itc_read(void)
     243 */
     244static inline uint64_t itc_read(void)
    256245{
    257246        uint64_t v;
     
    268257 *
    269258 * @param v New match value.
    270  *
    271  */
    272 NO_TRACE static inline void itm_write(uint64_t v)
     259 */
     260static inline void itm_write(uint64_t v)
    273261{
    274262        asm volatile (
     
    281269 *
    282270 * @return Match value.
    283  *
    284  */
    285 NO_TRACE static inline uint64_t itm_read(void)
     271 */
     272static inline uint64_t itm_read(void)
    286273{
    287274        uint64_t v;
     
    298285 *
    299286 * @return Current vector and mask bit.
    300  *
    301  */
    302 NO_TRACE static inline uint64_t itv_read(void)
     287 */
     288static inline uint64_t itv_read(void)
    303289{
    304290        uint64_t v;
     
    315301 *
    316302 * @param v New vector and mask bit.
    317  *
    318  */
    319 NO_TRACE static inline void itv_write(uint64_t v)
     303 */
     304static inline void itv_write(uint64_t v)
    320305{
    321306        asm volatile (
     
    328313 *
    329314 * @param v This value is ignored.
    330  *
    331  */
    332 NO_TRACE static inline void eoi_write(uint64_t v)
     315 */
     316static inline void eoi_write(uint64_t v)
    333317{
    334318        asm volatile (
     
    341325 *
    342326 * @return Current value of TPR.
    343  *
    344  */
    345 NO_TRACE static inline uint64_t tpr_read(void)
     327 */
     328static inline uint64_t tpr_read(void)
    346329{
    347330        uint64_t v;
     
    358341 *
    359342 * @param v New value of TPR.
    360  *
    361  */
    362 NO_TRACE static inline void tpr_write(uint64_t v)
     343 */
     344static inline void tpr_write(uint64_t v)
    363345{
    364346        asm volatile (
     
    374356 *
    375357 * @return Old interrupt priority level.
    376  *
    377  */
    378 NO_TRACE static ipl_t interrupts_disable(void)
     358 */
     359static ipl_t interrupts_disable(void)
    379360{
    380361        uint64_t v;
     
    396377 *
    397378 * @return Old interrupt priority level.
    398  *
    399  */
    400 NO_TRACE static ipl_t interrupts_enable(void)
     379 */
     380static ipl_t interrupts_enable(void)
    401381{
    402382        uint64_t v;
     
    419399 *
    420400 * @param ipl Saved interrupt priority level.
    421  *
    422  */
    423 NO_TRACE static inline void interrupts_restore(ipl_t ipl)
     401 */
     402static inline void interrupts_restore(ipl_t ipl)
    424403{
    425404        if (ipl & PSR_I_MASK)
     
    432411 *
    433412 * @return PSR.
    434  *
    435  */
    436 NO_TRACE static inline ipl_t interrupts_read(void)
     413 */
     414static inline ipl_t interrupts_read(void)
    437415{
    438416        return (ipl_t) psr_read();
     
    444422 *
    445423 */
    446 NO_TRACE static inline bool interrupts_disabled(void)
     424static inline bool interrupts_disabled(void)
    447425{
    448426        return !(psr_read() & PSR_I_MASK);
     
    450428
    451429/** Disable protection key checking. */
    452 NO_TRACE static inline void pk_disable(void)
     430static inline void pk_disable(void)
    453431{
    454432        asm volatile (
Note: See TracChangeset for help on using the changeset viewer.