Ignore:
File:
1 edited

Legend:

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

    rb3f8fb7 r3500f75  
    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>
    3954
    4055typedef struct {
    41         int version;
    42         int revision;
    43 } cpu_arch_t;
    44        
     56        uint16_t version;
     57        uint16_t revision;
     58} __attribute__ ((packed)) cpu_arch_t;
     59
     60static inline void cpu_version(cpu_arch_t *info)
     61{
     62        asm volatile (
     63                "mfpvr %[cpu_info]\n"
     64                : [cpu_info] "=r" (*info)
     65        );
     66}
     67
     68#endif /* __ASM__ */
     69
    4570#endif
    4671
Note: See TracChangeset for help on using the changeset viewer.