Ignore:
File:
1 edited

Legend:

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

    rb3f8fb7 r7a0359b  
    3636#define KERN_ppc32_CPU_H_
    3737
    38 #include <arch/asm.h>
     38/* MSR bits */
     39#define MSR_DR  (1 << 4)
     40#define MSR_IR  (1 << 5)
     41#define MSR_PR  (1 << 14)
     42#define MSR_EE  (1 << 15)
     43
     44/* HID0 bits */
     45#define HID0_STEN  (1 << 24)
     46#define HID0_ICE   (1 << 15)
     47#define HID0_DCE   (1 << 14)
     48#define HID0_ICFI  (1 << 11)
     49#define HID0_DCI   (1 << 10)
     50
     51#ifndef __ASM__
     52
     53#include <typedefs.h>
     54#include <trace.h>
    3955
    4056typedef struct {
    41         int version;
    42         int revision;
    43 } cpu_arch_t;
    44        
     57        uint16_t version;
     58        uint16_t revision;
     59} __attribute__ ((packed)) cpu_arch_t;
     60
     61NO_TRACE static inline void cpu_version(cpu_arch_t *info)
     62{
     63        asm volatile (
     64                "mfpvr %[cpu_info]\n"
     65                : [cpu_info] "=r" (*info)
     66        );
     67}
     68
     69#endif /* __ASM__ */
     70
    4571#endif
    4672
Note: See TracChangeset for help on using the changeset viewer.