Changeset 7a0359b in mainline for kernel/arch/ia64/include/cpu.h


Ignore:
Timestamp:
2010-07-02T15:42:19Z (14 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)

File:
1 edited

Legend:

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

    re3ee9b9 r7a0359b  
    4040#include <arch/asm.h>
    4141#include <arch/bootinfo.h>
     42#include <trace.h>
    4243
    43 #define FAMILY_ITANIUM  0x7
    44 #define FAMILY_ITANIUM2 0x1f
     44#define FAMILY_ITANIUM   0x7
     45#define FAMILY_ITANIUM2  0x1f
     46
     47#define CR64_ID_SHIFT   24
     48#define CR64_ID_MASK    0xff000000
     49#define CR64_EID_SHIFT  16
     50#define CR64_EID_MASK   0xff0000
    4551
    4652typedef struct {
     
    5561 *
    5662 * @return Value of CPUID[n] register.
     63 *
    5764 */
    58 static inline uint64_t cpuid_read(int n)
     65NO_TRACE static inline uint64_t cpuid_read(int n)
    5966{
    6067        uint64_t v;
    6168       
    62         asm volatile ("mov %0 = cpuid[%1]\n" : "=r" (v) : "r" (n));
     69        asm volatile (
     70                "mov %[v] = cpuid[%[r]]\n"
     71                : [v] "=r" (v)
     72                : [r] "r" (n)
     73        );
    6374       
    6475        return v;
    6576}
    6677
    67 
    68 #define CR64_ID_SHIFT 24
    69 #define CR64_ID_MASK 0xff000000
    70 #define CR64_EID_SHIFT 16
    71 #define CR64_EID_MASK 0xff0000
    72 
    73 static inline int ia64_get_cpu_id(void)
     78NO_TRACE static inline int ia64_get_cpu_id(void)
    7479{
    75         uint64_t cr64=cr64_read();
    76         return ((CR64_ID_MASK)&cr64)>>CR64_ID_SHIFT;
     80        uint64_t cr64 = cr64_read();
     81        return ((CR64_ID_MASK) &cr64) >> CR64_ID_SHIFT;
    7782}
    7883
    79 static inline int ia64_get_cpu_eid(void)
     84NO_TRACE static inline int ia64_get_cpu_eid(void)
    8085{
    81         uint64_t cr64=cr64_read();
    82         return ((CR64_EID_MASK)&cr64)>>CR64_EID_SHIFT;
     86        uint64_t cr64 = cr64_read();
     87        return ((CR64_EID_MASK) &cr64) >> CR64_EID_SHIFT;
    8388}
    8489
    85 
    86 static inline void ipi_send_ipi(int id, int eid, int intno)
     90NO_TRACE static inline void ipi_send_ipi(int id, int eid, int intno)
    8791{
    8892        (bootinfo->sapic)[2 * (id * 256 + eid)] = intno;
    8993        srlz_d();
    90 
    9194}
    9295
Note: See TracChangeset for help on using the changeset viewer.