vdso_datapage.h 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  1. #ifndef _VDSO_DATAPAGE_H
  2. #define _VDSO_DATAPAGE_H
  3. /*
  4. * Copyright (C) 2002 Peter Bergner <bergner@vnet.ibm.com>, IBM
  5. * Copyright (C) 2005 Benjamin Herrenschmidy <benh@kernel.crashing.org>,
  6. * IBM Corp.
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public License
  10. * as published by the Free Software Foundation; either version
  11. * 2 of the License, or (at your option) any later version.
  12. */
  13. /*
  14. * Note about this structure:
  15. *
  16. * This structure was historically called systemcfg and exposed to
  17. * userland via /proc/ppc64/systemcfg. Unfortunately, this became an
  18. * ABI issue as some proprietary software started relying on being able
  19. * to mmap() it, thus we have to keep the base layout at least for a
  20. * few kernel versions.
  21. *
  22. * However, since ppc32 doesn't suffer from this backward handicap,
  23. * a simpler version of the data structure is used there with only the
  24. * fields actually used by the vDSO.
  25. *
  26. */
  27. /*
  28. * If the major version changes we are incompatible.
  29. * Minor version changes are a hint.
  30. */
  31. #define SYSTEMCFG_MAJOR 1
  32. #define SYSTEMCFG_MINOR 1
  33. #ifndef __ASSEMBLY__
  34. #include <linux/unistd.h>
  35. #define SYSCALL_MAP_SIZE ((__NR_syscalls + 31) / 32)
  36. /*
  37. * So here is the ppc64 backward compatible version
  38. */
  39. #ifdef CONFIG_PPC64
  40. struct vdso_data {
  41. __u8 eye_catcher[16]; /* Eyecatcher: SYSTEMCFG:PPC64 0x00 */
  42. struct { /* Systemcfg version numbers */
  43. __u32 major; /* Major number 0x10 */
  44. __u32 minor; /* Minor number 0x14 */
  45. } version;
  46. __u32 platform; /* Platform flags 0x18 */
  47. __u32 processor; /* Processor type 0x1C */
  48. __u64 processorCount; /* # of physical processors 0x20 */
  49. __u64 physicalMemorySize; /* Size of real memory(B) 0x28 */
  50. __u64 tb_orig_stamp; /* Timebase at boot 0x30 */
  51. __u64 tb_ticks_per_sec; /* Timebase tics / sec 0x38 */
  52. __u64 tb_to_xs; /* Inverse of TB to 2^20 0x40 */
  53. __u64 stamp_xsec; /* 0x48 */
  54. __u64 tb_update_count; /* Timebase atomicity ctr 0x50 */
  55. __u32 tz_minuteswest; /* Minutes west of Greenwich 0x58 */
  56. __u32 tz_dsttime; /* Type of dst correction 0x5C */
  57. __u32 dcache_size; /* L1 d-cache size 0x60 */
  58. __u32 dcache_line_size; /* L1 d-cache line size 0x64 */
  59. __u32 icache_size; /* L1 i-cache size 0x68 */
  60. __u32 icache_line_size; /* L1 i-cache line size 0x6C */
  61. /* those additional ones don't have to be located anywhere
  62. * special as they were not part of the original systemcfg
  63. */
  64. __s32 wtom_clock_sec; /* Wall to monotonic clock */
  65. __s32 wtom_clock_nsec;
  66. __u32 syscall_map_64[SYSCALL_MAP_SIZE]; /* map of syscalls */
  67. __u32 syscall_map_32[SYSCALL_MAP_SIZE]; /* map of syscalls */
  68. };
  69. #else /* CONFIG_PPC64 */
  70. /*
  71. * And here is the simpler 32 bits version
  72. */
  73. struct vdso_data {
  74. __u64 tb_orig_stamp; /* Timebase at boot 0x30 */
  75. __u64 tb_ticks_per_sec; /* Timebase tics / sec 0x38 */
  76. __u64 tb_to_xs; /* Inverse of TB to 2^20 0x40 */
  77. __u64 stamp_xsec; /* 0x48 */
  78. __u32 tb_update_count; /* Timebase atomicity ctr 0x50 */
  79. __u32 tz_minuteswest; /* Minutes west of Greenwich 0x58 */
  80. __u32 tz_dsttime; /* Type of dst correction 0x5C */
  81. __s32 wtom_clock_sec; /* Wall to monotonic clock */
  82. __s32 wtom_clock_nsec;
  83. __u32 syscall_map_32[SYSCALL_MAP_SIZE]; /* map of syscalls */
  84. };
  85. #endif /* CONFIG_PPC64 */
  86. #ifdef __KERNEL__
  87. extern struct vdso_data *vdso_data;
  88. #endif
  89. #endif /* __ASSEMBLY__ */
  90. #endif /* _SYSTEMCFG_H */