setup.h 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. /*
  2. * include/asm-s390/setup.h
  3. *
  4. * S390 version
  5. * Copyright IBM Corp. 1999,2006
  6. */
  7. #ifndef _ASM_S390_SETUP_H
  8. #define _ASM_S390_SETUP_H
  9. #define COMMAND_LINE_SIZE 4096
  10. #define ARCH_COMMAND_LINE_SIZE 896
  11. #ifdef __KERNEL__
  12. #include <asm/lowcore.h>
  13. #include <asm/types.h>
  14. #define PARMAREA 0x10400
  15. #define MEMORY_CHUNKS 256
  16. #ifndef __ASSEMBLY__
  17. #ifndef __s390x__
  18. #define IPL_DEVICE (*(unsigned long *) (0x10404))
  19. #define INITRD_START (*(unsigned long *) (0x1040C))
  20. #define INITRD_SIZE (*(unsigned long *) (0x10414))
  21. #else /* __s390x__ */
  22. #define IPL_DEVICE (*(unsigned long *) (0x10400))
  23. #define INITRD_START (*(unsigned long *) (0x10408))
  24. #define INITRD_SIZE (*(unsigned long *) (0x10410))
  25. #endif /* __s390x__ */
  26. #define COMMAND_LINE ((char *) (0x10480))
  27. #define CHUNK_READ_WRITE 0
  28. #define CHUNK_READ_ONLY 1
  29. struct mem_chunk {
  30. unsigned long addr;
  31. unsigned long size;
  32. int type;
  33. };
  34. extern struct mem_chunk memory_chunk[];
  35. extern unsigned long real_memory_size;
  36. extern int memory_end_set;
  37. extern unsigned long memory_end;
  38. void detect_memory_layout(struct mem_chunk chunk[]);
  39. #define PRIMARY_SPACE_MODE 0
  40. #define ACCESS_REGISTER_MODE 1
  41. #define SECONDARY_SPACE_MODE 2
  42. #define HOME_SPACE_MODE 3
  43. extern unsigned int user_mode;
  44. /*
  45. * Machine features detected in head.S
  46. */
  47. #define MACHINE_FLAG_VM (1UL << 0)
  48. #define MACHINE_FLAG_IEEE (1UL << 1)
  49. #define MACHINE_FLAG_CSP (1UL << 3)
  50. #define MACHINE_FLAG_MVPG (1UL << 4)
  51. #define MACHINE_FLAG_DIAG44 (1UL << 5)
  52. #define MACHINE_FLAG_IDTE (1UL << 6)
  53. #define MACHINE_FLAG_DIAG9C (1UL << 7)
  54. #define MACHINE_FLAG_MVCOS (1UL << 8)
  55. #define MACHINE_FLAG_KVM (1UL << 9)
  56. #define MACHINE_FLAG_HPAGE (1UL << 10)
  57. #define MACHINE_FLAG_PFMF (1UL << 11)
  58. #define MACHINE_IS_VM (S390_lowcore.machine_flags & MACHINE_FLAG_VM)
  59. #define MACHINE_IS_KVM (S390_lowcore.machine_flags & MACHINE_FLAG_KVM)
  60. #define MACHINE_HAS_DIAG9C (S390_lowcore.machine_flags & MACHINE_FLAG_DIAG9C)
  61. #ifndef __s390x__
  62. #define MACHINE_HAS_IEEE (S390_lowcore.machine_flags & MACHINE_FLAG_IEEE)
  63. #define MACHINE_HAS_CSP (S390_lowcore.machine_flags & MACHINE_FLAG_CSP)
  64. #define MACHINE_HAS_IDTE (0)
  65. #define MACHINE_HAS_DIAG44 (1)
  66. #define MACHINE_HAS_MVPG (S390_lowcore.machine_flags & MACHINE_FLAG_MVPG)
  67. #define MACHINE_HAS_MVCOS (0)
  68. #define MACHINE_HAS_HPAGE (0)
  69. #define MACHINE_HAS_PFMF (0)
  70. #else /* __s390x__ */
  71. #define MACHINE_HAS_IEEE (1)
  72. #define MACHINE_HAS_CSP (1)
  73. #define MACHINE_HAS_IDTE (S390_lowcore.machine_flags & MACHINE_FLAG_IDTE)
  74. #define MACHINE_HAS_DIAG44 (S390_lowcore.machine_flags & MACHINE_FLAG_DIAG44)
  75. #define MACHINE_HAS_MVPG (1)
  76. #define MACHINE_HAS_MVCOS (S390_lowcore.machine_flags & MACHINE_FLAG_MVCOS)
  77. #define MACHINE_HAS_HPAGE (S390_lowcore.machine_flags & MACHINE_FLAG_HPAGE)
  78. #define MACHINE_HAS_PFMF (S390_lowcore.machine_flags & MACHINE_FLAG_PFMF)
  79. #endif /* __s390x__ */
  80. #define ZFCPDUMP_HSA_SIZE (32UL<<20)
  81. /*
  82. * Console mode. Override with conmode=
  83. */
  84. extern unsigned int console_mode;
  85. extern unsigned int console_devno;
  86. extern unsigned int console_irq;
  87. extern char vmhalt_cmd[];
  88. extern char vmpoff_cmd[];
  89. #define CONSOLE_IS_UNDEFINED (console_mode == 0)
  90. #define CONSOLE_IS_SCLP (console_mode == 1)
  91. #define CONSOLE_IS_3215 (console_mode == 2)
  92. #define CONSOLE_IS_3270 (console_mode == 3)
  93. #define SET_CONSOLE_SCLP do { console_mode = 1; } while (0)
  94. #define SET_CONSOLE_3215 do { console_mode = 2; } while (0)
  95. #define SET_CONSOLE_3270 do { console_mode = 3; } while (0)
  96. #define NSS_NAME_SIZE 8
  97. extern char kernel_nss_name[];
  98. #else /* __ASSEMBLY__ */
  99. #ifndef __s390x__
  100. #define IPL_DEVICE 0x10404
  101. #define INITRD_START 0x1040C
  102. #define INITRD_SIZE 0x10414
  103. #else /* __s390x__ */
  104. #define IPL_DEVICE 0x10400
  105. #define INITRD_START 0x10408
  106. #define INITRD_SIZE 0x10410
  107. #endif /* __s390x__ */
  108. #define COMMAND_LINE 0x10480
  109. #endif /* __ASSEMBLY__ */
  110. #endif /* __KERNEL__ */
  111. #endif /* _ASM_S390_SETUP_H */