reg.h 624 B

1234567891011121314151617181920212223242526
  1. /* SPDX-License-Identifier: GPL-2.0-or-later */
  2. #ifndef _PPC_BOOT_REG_H
  3. #define _PPC_BOOT_REG_H
  4. /*
  5. * Copyright 2007 Davud Gibson, IBM Corporation.
  6. */
  7. static inline u32 mfpvr(void)
  8. {
  9. u32 pvr;
  10. asm volatile ("mfpvr %0" : "=r"(pvr));
  11. return pvr;
  12. }
  13. #define __stringify_1(x) #x
  14. #define __stringify(x) __stringify_1(x)
  15. #define mfspr(rn) ({unsigned long rval; \
  16. asm volatile("mfspr %0," __stringify(rn) \
  17. : "=r" (rval)); rval; })
  18. #define mtspr(rn, v) asm volatile("mtspr " __stringify(rn) ",%0" : : "r" (v))
  19. register void *__stack_pointer asm("r1");
  20. #define get_sp() (__stack_pointer)
  21. #endif /* _PPC_BOOT_REG_H */