nvram.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*
  2. * NVRAM definitions and access functions.
  3. *
  4. * This program is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU General Public License
  6. * as published by the Free Software Foundation; either version
  7. * 2 of the License, or (at your option) any later version.
  8. */
  9. #ifndef _UAPI_ASM_POWERPC_NVRAM_H
  10. #define _UAPI_ASM_POWERPC_NVRAM_H
  11. /* Signatures for nvram partitions */
  12. #define NVRAM_SIG_SP 0x02 /* support processor */
  13. #define NVRAM_SIG_OF 0x50 /* open firmware config */
  14. #define NVRAM_SIG_FW 0x51 /* general firmware */
  15. #define NVRAM_SIG_HW 0x52 /* hardware (VPD) */
  16. #define NVRAM_SIG_FLIP 0x5a /* Apple flip/flop header */
  17. #define NVRAM_SIG_APPL 0x5f /* Apple "system" (???) */
  18. #define NVRAM_SIG_SYS 0x70 /* system env vars */
  19. #define NVRAM_SIG_CFG 0x71 /* config data */
  20. #define NVRAM_SIG_ELOG 0x72 /* error log */
  21. #define NVRAM_SIG_VEND 0x7e /* vendor defined */
  22. #define NVRAM_SIG_FREE 0x7f /* Free space */
  23. #define NVRAM_SIG_OS 0xa0 /* OS defined */
  24. #define NVRAM_SIG_PANIC 0xa1 /* Apple OSX "panic" */
  25. /* PowerMac specific nvram stuffs */
  26. enum {
  27. pmac_nvram_OF, /* Open Firmware partition */
  28. pmac_nvram_XPRAM, /* MacOS XPRAM partition */
  29. pmac_nvram_NR /* MacOS Name Registry partition */
  30. };
  31. /* Some offsets in XPRAM */
  32. #define PMAC_XPRAM_MACHINE_LOC 0xe4
  33. #define PMAC_XPRAM_SOUND_VOLUME 0x08
  34. /* Machine location structure in PowerMac XPRAM */
  35. struct pmac_machine_location {
  36. unsigned int latitude; /* 2+30 bit Fractional number */
  37. unsigned int longitude; /* 2+30 bit Fractional number */
  38. unsigned int delta; /* mix of GMT delta and DLS */
  39. };
  40. /*
  41. * /dev/nvram ioctls
  42. *
  43. * Note that PMAC_NVRAM_GET_OFFSET is still supported, but is
  44. * definitely obsolete. Do not use it if you can avoid it
  45. */
  46. #define OBSOLETE_PMAC_NVRAM_GET_OFFSET \
  47. _IOWR('p', 0x40, int)
  48. #define IOC_NVRAM_GET_OFFSET _IOWR('p', 0x42, int) /* Get NVRAM partition offset */
  49. #define IOC_NVRAM_SYNC _IO('p', 0x43) /* Sync NVRAM image */
  50. #endif /* _UAPI_ASM_POWERPC_NVRAM_H */