reg.h 831 B

123456789101112131415161718192021222324252627282930
  1. #ifndef _PPC_BOOT_REG_H
  2. #define _PPC_BOOT_REG_H
  3. /*
  4. * Copyright 2007 Davud Gibson, IBM Corporation.
  5. *
  6. * This program is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU General Public License
  8. * as published by the Free Software Foundation; either version
  9. * 2 of the License, or (at your option) any later version.
  10. */
  11. static inline u32 mfpvr(void)
  12. {
  13. u32 pvr;
  14. asm volatile ("mfpvr %0" : "=r"(pvr));
  15. return pvr;
  16. }
  17. #define __stringify_1(x) #x
  18. #define __stringify(x) __stringify_1(x)
  19. #define mfspr(rn) ({unsigned long rval; \
  20. asm volatile("mfspr %0," __stringify(rn) \
  21. : "=r" (rval)); rval; })
  22. #define mtspr(rn, v) asm volatile("mtspr " __stringify(rn) ",%0" : : "r" (v))
  23. register void *__stack_pointer asm("r1");
  24. #define get_sp() (__stack_pointer)
  25. #endif /* _PPC_BOOT_REG_H */