kldir.h
上传用户:jlfgdled
上传日期:2013-04-10
资源大小:33168k
文件大小:18k
源码类别:

Linux/Unix编程

开发平台:

Unix_Linux

  1. /*
  2.  * This file is subject to the terms and conditions of the GNU General Public
  3.  * License.  See the file "COPYING" in the main directory of this archive
  4.  * for more details.
  5.  *
  6.  * Derived from IRIX <sys/SN/kldir.h>, revision 1.21.
  7.  *
  8.  * Copyright (C) 1992-1997,1999,2001-2002 Silicon Graphics, Inc.  All Rights Reserved.
  9.  * Copyright (C) 1999 by Ralf Baechle
  10.  */
  11. #ifndef _ASM_IA64_SN_KLDIR_H
  12. #define _ASM_IA64_SN_KLDIR_H
  13. #include <asm/sn/sgi.h>
  14. /*
  15.  * The kldir memory area resides at a fixed place in each node's memory and
  16.  * provides pointers to most other IP27 memory areas.  This allows us to
  17.  * resize and/or relocate memory areas at a later time without breaking all
  18.  * firmware and kernels that use them.  Indices in the array are
  19.  * permanently dedicated to areas listed below.  Some memory areas (marked
  20.  * below) reside at a permanently fixed location, but are included in the
  21.  * directory for completeness.
  22.  */
  23. #define KLDIR_MAGIC 0x434d5f53505f5357
  24. /*
  25.  * The upper portion of the memory map applies during boot
  26.  * only and is overwritten by IRIX/SYMMON.
  27.  *
  28.  *                                    MEMORY MAP PER NODE
  29.  *
  30.  * 0x2000000 (32M)         +-----------------------------------------+
  31.  *                         |      IO6 BUFFERS FOR FLASH ENET IOC3    |
  32.  * 0x1F80000 (31.5M)       +-----------------------------------------+
  33.  *                         |      IO6 TEXT/DATA/BSS/stack            |
  34.  * 0x1C00000 (30M)         +-----------------------------------------+
  35.  *                         |      IO6 PROM DEBUG TEXT/DATA/BSS/stack |
  36.  * 0x0800000 (28M)         +-----------------------------------------+
  37.  *                         |      IP27 PROM TEXT/DATA/BSS/stack      |
  38.  * 0x1B00000 (27M)         +-----------------------------------------+
  39.  *                         |      IP27 CFG                           |
  40.  * 0x1A00000 (26M)         +-----------------------------------------+
  41.  *                         |      Graphics PROM                      |
  42.  * 0x1800000 (24M)         +-----------------------------------------+
  43.  *                         |      3rd Party PROM drivers             |
  44.  * 0x1600000 (22M)         +-----------------------------------------+
  45.  *                         |                                         |
  46.  *                         |      Free                               |
  47.  *                         |                                         |
  48.  *                         +-----------------------------------------+
  49.  *                         |      UNIX DEBUG Version                 |
  50.  * 0x190000 (2M--)         +-----------------------------------------+
  51.  *                         |      SYMMON                             |
  52.  *                         |      (For UNIX Debug only)              |
  53.  * 0x34000 (208K)          +-----------------------------------------+
  54.  *                         |      SYMMON STACK [NUM_CPU_PER_NODE]    |
  55.  *                         |      (For UNIX Debug only)              |
  56.  * 0x25000 (148K)          +-----------------------------------------+
  57.  *                         |      KLCONFIG - II (temp)               |
  58.  *                         |                                         |
  59.  *                         |    ----------------------------         |
  60.  *                         |                                         |
  61.  *                         |      UNIX NON-DEBUG Version             |
  62.  * 0x19000 (100K)          +-----------------------------------------+
  63.  *
  64.  *
  65.  * The lower portion of the memory map contains information that is
  66.  * permanent and is used by the IP27PROM, IO6PROM and IRIX.
  67.  *
  68.  * 0x19000 (100K)          +-----------------------------------------+
  69.  *                         |                                         |
  70.  *                         |      PI Error Spools (32K)              |
  71.  *                         |                                         |
  72.  * 0x12000 (72K)           +-----------------------------------------+
  73.  *                         |      Unused                             |
  74.  * 0x11c00 (71K)           +-----------------------------------------+
  75.  *                         |      CPU 1 NMI Eframe area             |
  76.  * 0x11a00 (70.5K)         +-----------------------------------------+
  77.  *                         |      CPU 0 NMI Eframe area             |
  78.  * 0x11800 (70K)           +-----------------------------------------+
  79.  *                         |      CPU 1 NMI Register save area       |
  80.  * 0x11600 (69.5K)         +-----------------------------------------+
  81.  *                         |      CPU 0 NMI Register save area       |
  82.  * 0x11400 (69K)           +-----------------------------------------+
  83.  *                         |      GDA (1k)                           |
  84.  * 0x11000 (68K)           +-----------------------------------------+
  85.  *                         |      Early cache Exception stack        |
  86.  *                         |             and/or                      |
  87.  *    |      kernel/io6prom nmi registers      |
  88.  * 0x10800  (66k)    +-----------------------------------------+
  89.  *    |      cache error eframe           |
  90.  * 0x10400 (65K)           +-----------------------------------------+
  91.  *                         |      Exception Handlers (UALIAS copy)   |
  92.  * 0x10000 (64K)           +-----------------------------------------+
  93.  *                         |                                         |
  94.  *                         |                                         |
  95.  *                         |      KLCONFIG - I (permanent) (48K)     |
  96.  *                         |                                         |
  97.  *                         |                                         |
  98.  *                         |                                         |
  99.  * 0x4000 (16K)            +-----------------------------------------+
  100.  *                         |      NMI Handler (Protected Page)       |
  101.  * 0x3000 (12K)            +-----------------------------------------+
  102.  *                         |      ARCS PVECTORS (master node only)   |
  103.  * 0x2c00 (11K)            +-----------------------------------------+
  104.  *                         |      ARCS TVECTORS (master node only)   |
  105.  * 0x2800 (10K)            +-----------------------------------------+
  106.  *                         |      LAUNCH [NUM_CPU]                   |
  107.  * 0x2400 (9K)             +-----------------------------------------+
  108.  *                         |      Low memory directory (KLDIR)       |
  109.  * 0x2000 (8K)             +-----------------------------------------+
  110.  *                         |      ARCS SPB (1K)                      |
  111.  * 0x1000 (4K)             +-----------------------------------------+
  112.  *                         |      Early cache Exception stack        |
  113.  *                         |             and/or                      |
  114.  *    |      kernel/io6prom nmi registers      |
  115.  * 0x800  (2k)            +-----------------------------------------+
  116.  *    |      cache error eframe           |
  117.  * 0x400 (1K)              +-----------------------------------------+
  118.  *                         |      Exception Handlers                 |
  119.  * 0x0   (0K)              +-----------------------------------------+
  120.  */
  121. #ifdef __ASSEMBLY__
  122. #define KLDIR_OFF_MAGIC 0x00
  123. #define KLDIR_OFF_OFFSET 0x08
  124. #define KLDIR_OFF_POINTER 0x10
  125. #define KLDIR_OFF_SIZE 0x18
  126. #define KLDIR_OFF_COUNT 0x20
  127. #define KLDIR_OFF_STRIDE 0x28
  128. #endif /* __ASSEMBLY__ */
  129. #ifndef __ASSEMBLY__
  130. typedef struct kldir_ent_s {
  131. u64 magic; /* Indicates validity of entry      */
  132. off_t offset; /* Offset from start of node space  */
  133. __psunsigned_t pointer; /* Pointer to area in some cases    */
  134. size_t size; /* Size in bytes      */
  135. u64 count; /* Repeat count if array, 1 if not  */
  136. size_t stride; /* Stride if array, 0 if not        */
  137. char rsvd[16]; /* Pad entry to 0x40 bytes          */
  138. /* NOTE: These 16 bytes are used in the Partition KLDIR
  139.    entry to store partition info. Refer to klpart.h for this. */
  140. } kldir_ent_t;
  141. #endif /* __ASSEMBLY__ */
  142. #define KLDIR_ENT_SIZE 0x40
  143. #define KLDIR_MAX_ENTRIES (0x400 / 0x40)
  144. /*
  145.  * The upper portion of the memory map applies during boot
  146.  * only and is overwritten by IRIX/SYMMON.  The minimum memory bank
  147.  * size on IP35 is 64M, which provides a limit on the amount of space
  148.  * the PROM can assume it has available.
  149.  *
  150.  * Most of the addresses below are defined as macros in this file, or
  151.  * in SN/addrs.h or SN/SN1/addrs.h.
  152.  *
  153.  *                                    MEMORY MAP PER NODE
  154.  *
  155.  * 0x4000000 (64M)         +-----------------------------------------+
  156.  *                         |                                         |
  157.  *                         |                                         |
  158.  *                         |      IO7 TEXT/DATA/BSS/stack            |
  159.  * 0x3000000 (48M)         +-----------------------------------------+
  160.  *                         |      Free                               |
  161.  * 0x2102000 (>33M)        +-----------------------------------------+
  162.  *                         |      IP35 Topology (PCFG) + misc data   |
  163.  * 0x2000000 (32M)         +-----------------------------------------+
  164.  *                         |      IO7 BUFFERS FOR FLASH ENET IOC3    |
  165.  * 0x1F80000 (31.5M)       +-----------------------------------------+
  166.  *                         |      Free                               |
  167.  * 0x1C00000 (28M)         +-----------------------------------------+
  168.  *                         |      IP35 PROM TEXT/DATA/BSS/stack      |
  169.  * 0x1A00000 (26M)         +-----------------------------------------+
  170.  *                         |      Routing temp. space                |
  171.  * 0x1800000 (24M)         +-----------------------------------------+
  172.  *                         |      Diagnostics temp. space            |
  173.  * 0x1500000 (21M)         +-----------------------------------------+
  174.  *                         |      Free                               |
  175.  * 0x1400000 (20M)         +-----------------------------------------+
  176.  *                         |      IO7 PROM temporary copy            |
  177.  * 0x1300000 (19M)         +-----------------------------------------+
  178.  *                         |                                         |
  179.  *                         |      Free                               |
  180.  *                         |      (UNIX DATA starts above 0x1000000) |
  181.  *                         |                                         |
  182.  *                         +-----------------------------------------+
  183.  *                         |      UNIX DEBUG Version                 |
  184.  * 0x0310000 (3.1M)        +-----------------------------------------+
  185.  *                         |      SYMMON, loaded just below UNIX     |
  186.  *                         |      (For UNIX Debug only)              |
  187.  *                         |                                         |
  188.  *                         |                                         |
  189.  * 0x006C000 (432K)        +-----------------------------------------+
  190.  *                         |      SYMMON STACK [NUM_CPU_PER_NODE]    |
  191.  *                         |      (For UNIX Debug only)              |
  192.  * 0x004C000 (304K)        +-----------------------------------------+
  193.  *                         |                                         |
  194.  *                         |                                         |
  195.  *                         |      UNIX NON-DEBUG Version             |
  196.  * 0x0040000 (256K)        +-----------------------------------------+
  197.  *
  198.  *
  199.  * The lower portion of the memory map contains information that is
  200.  * permanent and is used by the IP35PROM, IO7PROM and IRIX.
  201.  *
  202.  * 0x40000 (256K)          +-----------------------------------------+
  203.  *                         |                                         |
  204.  *                         |      KLCONFIG (64K)                     |
  205.  *                         |                                         |
  206.  * 0x30000 (192K)          +-----------------------------------------+
  207.  *                         |                                         |
  208.  *                         |      PI Error Spools (64K)              |
  209.  *                         |                                         |
  210.  * 0x20000 (128K)          +-----------------------------------------+
  211.  *                         |                                         |
  212.  *                         |      Unused                             |
  213.  *                         |                                         |
  214.  * 0x19000 (100K)          +-----------------------------------------+
  215.  *                         |      Early cache Exception stack (CPU 3)|
  216.  * 0x18800 (98K)           +-----------------------------------------+
  217.  *    |      cache error eframe (CPU 3)      |
  218.  * 0x18400 (97K)           +-----------------------------------------+
  219.  *                         |      Exception Handlers (CPU 3)         |
  220.  * 0x18000 (96K)           +-----------------------------------------+
  221.  *                         |                                         |
  222.  *                         |      Unused                             |
  223.  *                         |                                         |
  224.  * 0x13c00 (79K)           +-----------------------------------------+
  225.  *                         |      GPDA (8k)                          |
  226.  * 0x11c00 (71K)           +-----------------------------------------+
  227.  *                         |      Early cache Exception stack (CPU 2)|
  228.  * 0x10800 (66k)    +-----------------------------------------+
  229.  *    |      cache error eframe (CPU 2)      |
  230.  * 0x10400 (65K)           +-----------------------------------------+
  231.  *                         |      Exception Handlers (CPU 2)         |
  232.  * 0x10000 (64K)           +-----------------------------------------+
  233.  *                         |                                         |
  234.  *                         |      Unused                             |
  235.  *                         |                                         |
  236.  * 0x0b400 (45K)           +-----------------------------------------+
  237.  *                         |      GDA (1k)                           |
  238.  * 0x0b000 (44K)           +-----------------------------------------+
  239.  *                         |      NMI Eframe areas (4)             |
  240.  * 0x0a000 (40K)           +-----------------------------------------+
  241.  *                         |      NMI Register save areas (4)        |
  242.  * 0x09000 (36K)           +-----------------------------------------+
  243.  *                         |      Early cache Exception stack (CPU 1)|
  244.  * 0x08800 (34K)           +-----------------------------------------+
  245.  *    |      cache error eframe (CPU 1)      |
  246.  * 0x08400 (33K)           +-----------------------------------------+
  247.  *                         |      Exception Handlers (CPU 1)         |
  248.  * 0x08000 (32K)           +-----------------------------------------+
  249.  *                         |                                         |
  250.  *                         |                                         |
  251.  *                         |      Unused                             |
  252.  *                         |                                         |
  253.  *                         |                                         |
  254.  * 0x04000 (16K)           +-----------------------------------------+
  255.  *                         |      NMI Handler (Protected Page)       |
  256.  * 0x03000 (12K)           +-----------------------------------------+
  257.  *                         |      ARCS PVECTORS (master node only)   |
  258.  * 0x02c00 (11K)           +-----------------------------------------+
  259.  *                         |      ARCS TVECTORS (master node only)   |
  260.  * 0x02800 (10K)           +-----------------------------------------+
  261.  *                         |      LAUNCH [NUM_CPU]                   |
  262.  * 0x02400 (9K)            +-----------------------------------------+
  263.  *                         |      Low memory directory (KLDIR)       |
  264.  * 0x02000 (8K)            +-----------------------------------------+
  265.  *                         |      ARCS SPB (1K)                      |
  266.  * 0x01000 (4K)            +-----------------------------------------+
  267.  *                         |      Early cache Exception stack (CPU 0)|
  268.  * 0x00800 (2k)            +-----------------------------------------+
  269.  *    |      cache error eframe (CPU 0)      |
  270.  * 0x00400 (1K)            +-----------------------------------------+
  271.  *                         |      Exception Handlers (CPU 0)         |
  272.  * 0x00000 (0K)            +-----------------------------------------+
  273.  */
  274. /*
  275.  * NOTE:  To change the kernel load address, you must update:
  276.  *  - the appropriate elspec files in irix/kern/master.d
  277.  *  - NODEBUGUNIX_ADDR in SN/SN1/addrs.h
  278.  *  - IP27_FREEMEM_OFFSET below
  279.  *  - KERNEL_START_OFFSET below (if supporting cells)
  280.  */
  281. /*
  282.  * This is defined here because IP27_SYMMON_STK_SIZE must be at least what
  283.  * we define here.  Since it's set up in the prom.  We can't redefine it later
  284.  * and expect more space to be allocated.  The way to find out the true size
  285.  * of the symmon stacks is to divide SYMMON_STK_SIZE by SYMMON_STK_STRIDE
  286.  * for a particular node.
  287.  */
  288. #define SYMMON_STACK_SIZE 0x8000
  289. #if defined (PROM) || defined (SABLE)
  290. /*
  291.  * These defines are prom version dependent.  No code other than the IP35
  292.  * prom should attempt to use these values.
  293.  */
  294. #define IP27_LAUNCH_OFFSET 0x2400
  295. #define IP27_LAUNCH_SIZE 0x400
  296. #define IP27_LAUNCH_COUNT 4
  297. #define IP27_LAUNCH_STRIDE 0x100 /* could be as small as 0x80 */
  298. #define IP27_KLCONFIG_OFFSET 0x30000
  299. #define IP27_KLCONFIG_SIZE 0x10000
  300. #define IP27_KLCONFIG_COUNT 1
  301. #define IP27_KLCONFIG_STRIDE 0
  302. #define IP27_NMI_OFFSET 0x3000
  303. #define IP27_NMI_SIZE 0x100
  304. #define IP27_NMI_COUNT 4
  305. #define IP27_NMI_STRIDE 0x40
  306. #define IP27_PI_ERROR_OFFSET 0x20000
  307. #define IP27_PI_ERROR_SIZE 0x10000
  308. #define IP27_PI_ERROR_COUNT 1
  309. #define IP27_PI_ERROR_STRIDE 0
  310. #define IP27_SYMMON_STK_OFFSET 0x4c000
  311. #define IP27_SYMMON_STK_SIZE 0x20000
  312. #define IP27_SYMMON_STK_COUNT 4
  313. /* IP27_SYMMON_STK_STRIDE must be >= SYMMON_STACK_SIZE */
  314. #define IP27_SYMMON_STK_STRIDE 0x8000
  315. #define IP27_FREEMEM_OFFSET 0x40000
  316. #define IP27_FREEMEM_SIZE (-1)
  317. #define IP27_FREEMEM_COUNT 1
  318. #define IP27_FREEMEM_STRIDE 0
  319. #endif /* PROM || SABLE*/
  320. /*
  321.  * There will be only one of these in a partition so the IO7 must set it up.
  322.  */
  323. #define IO6_GDA_OFFSET 0xb000
  324. #define IO6_GDA_SIZE 0x400
  325. #define IO6_GDA_COUNT 1
  326. #define IO6_GDA_STRIDE 0
  327. /*
  328.  * save area of kernel nmi regs in the prom format
  329.  */
  330. #define IP27_NMI_KREGS_OFFSET 0x9000
  331. #define IP27_NMI_KREGS_CPU_SIZE 0x400
  332. /*
  333.  * save area of kernel nmi regs in eframe format 
  334.  */
  335. #define IP27_NMI_EFRAME_OFFSET 0xa000
  336. #define IP27_NMI_EFRAME_SIZE 0x400
  337. #define GPDA_OFFSET 0x11c00
  338. #endif /* _ASM_IA64_SN_KLDIR_H */