kldir.h
上传用户:lgb322
上传日期:2013-02-24
资源大小:30529k
文件大小:8k
源码类别:

嵌入式Linux

开发平台:

Unix_Linux

  1. /* $Id$
  2.  *
  3.  * This file is subject to the terms and conditions of the GNU General Public
  4.  * License.  See the file "COPYING" in the main directory of this archive
  5.  * for more details.
  6.  *
  7.  * Derived from IRIX <sys/SN/kldir.h>, revision 1.21.
  8.  *
  9.  * Copyright (C) 1992 - 1997, 1999 Silicon Graphics, Inc.
  10.  * Copyright (C) 1999 by Ralf Baechle
  11.  */
  12. #ifndef _ASM_SN_KLDIR_H
  13. #define _ASM_SN_KLDIR_H
  14. #include <linux/config.h>
  15. #include <asm/sn/sgi.h>
  16. /*
  17.  * The kldir memory area resides at a fixed place in each node's memory and
  18.  * provides pointers to most other IP27 memory areas.  This allows us to
  19.  * resize and/or relocate memory areas at a later time without breaking all
  20.  * firmware and kernels that use them.  Indices in the array are
  21.  * permanently dedicated to areas listed below.  Some memory areas (marked
  22.  * below) reside at a permanently fixed location, but are included in the
  23.  * directory for completeness.
  24.  */
  25. #define KLDIR_MAGIC 0x434d5f53505f5357
  26. /*
  27.  * The upper portion of the memory map applies during boot
  28.  * only and is overwritten by IRIX/SYMMON.
  29.  *
  30.  *                                    MEMORY MAP PER NODE
  31.  *
  32.  * 0x2000000 (32M)         +-----------------------------------------+
  33.  *                         |      IO6 BUFFERS FOR FLASH ENET IOC3    |
  34.  * 0x1F80000 (31.5M)       +-----------------------------------------+
  35.  *                         |      IO6 TEXT/DATA/BSS/stack            |
  36.  * 0x1C00000 (30M)         +-----------------------------------------+
  37.  *                         |      IO6 PROM DEBUG TEXT/DATA/BSS/stack |
  38.  * 0x0800000 (28M)         +-----------------------------------------+
  39.  *                         |      IP27 PROM TEXT/DATA/BSS/stack      |
  40.  * 0x1B00000 (27M)         +-----------------------------------------+
  41.  *                         |      IP27 CFG                           |
  42.  * 0x1A00000 (26M)         +-----------------------------------------+
  43.  *                         |      Graphics PROM                      |
  44.  * 0x1800000 (24M)         +-----------------------------------------+
  45.  *                         |      3rd Party PROM drivers             |
  46.  * 0x1600000 (22M)         +-----------------------------------------+
  47.  *                         |                                         |
  48.  *                         |      Free                               |
  49.  *                         |                                         |
  50.  *                         +-----------------------------------------+
  51.  *                         |      UNIX DEBUG Version                 |
  52.  * 0x190000 (2M--)         +-----------------------------------------+
  53.  *                         |      SYMMON                             |
  54.  *                         |      (For UNIX Debug only)              |
  55.  * 0x34000 (208K)          +-----------------------------------------+
  56.  *                         |      SYMMON STACK [NUM_CPU_PER_NODE]    |
  57.  *                         |      (For UNIX Debug only)              |
  58.  * 0x25000 (148K)          +-----------------------------------------+
  59.  *                         |      KLCONFIG - II (temp)               |
  60.  *                         |                                         |
  61.  *                         |    ----------------------------         |
  62.  *                         |                                         |
  63.  *                         |      UNIX NON-DEBUG Version             |
  64.  * 0x19000 (100K)          +-----------------------------------------+
  65.  *
  66.  *
  67.  * The lower portion of the memory map contains information that is
  68.  * permanent and is used by the IP27PROM, IO6PROM and IRIX.
  69.  *
  70.  * 0x19000 (100K)          +-----------------------------------------+
  71.  *                         |                                         |
  72.  *                         |      PI Error Spools (32K)              |
  73.  *                         |                                         |
  74.  * 0x12000 (72K)           +-----------------------------------------+
  75.  *                         |      Unused                             |
  76.  * 0x11c00 (71K)           +-----------------------------------------+
  77.  *                         |      CPU 1 NMI Eframe area             |
  78.  * 0x11a00 (70.5K)         +-----------------------------------------+
  79.  *                         |      CPU 0 NMI Eframe area             |
  80.  * 0x11800 (70K)           +-----------------------------------------+
  81.  *                         |      CPU 1 NMI Register save area       |
  82.  * 0x11600 (69.5K)         +-----------------------------------------+
  83.  *                         |      CPU 0 NMI Register save area       |
  84.  * 0x11400 (69K)           +-----------------------------------------+
  85.  *                         |      GDA (1k)                           |
  86.  * 0x11000 (68K)           +-----------------------------------------+
  87.  *                         |      Early cache Exception stack        |
  88.  *                         |             and/or                      |
  89.  *    |      kernel/io6prom nmi registers      |
  90.  * 0x10800  (66k)    +-----------------------------------------+
  91.  *    |      cache error eframe           |
  92.  * 0x10400 (65K)           +-----------------------------------------+
  93.  *                         |      Exception Handlers (UALIAS copy)   |
  94.  * 0x10000 (64K)           +-----------------------------------------+
  95.  *                         |                                         |
  96.  *                         |                                         |
  97.  *                         |      KLCONFIG - I (permanent) (48K)     |
  98.  *                         |                                         |
  99.  *                         |                                         |
  100.  *                         |                                         |
  101.  * 0x4000 (16K)            +-----------------------------------------+
  102.  *                         |      NMI Handler (Protected Page)       |
  103.  * 0x3000 (12K)            +-----------------------------------------+
  104.  *                         |      ARCS PVECTORS (master node only)   |
  105.  * 0x2c00 (11K)            +-----------------------------------------+
  106.  *                         |      ARCS TVECTORS (master node only)   |
  107.  * 0x2800 (10K)            +-----------------------------------------+
  108.  *                         |      LAUNCH [NUM_CPU]                   |
  109.  * 0x2400 (9K)             +-----------------------------------------+
  110.  *                         |      Low memory directory (KLDIR)       |
  111.  * 0x2000 (8K)             +-----------------------------------------+
  112.  *                         |      ARCS SPB (1K)                      |
  113.  * 0x1000 (4K)             +-----------------------------------------+
  114.  *                         |      Early cache Exception stack        |
  115.  *                         |             and/or                      |
  116.  *    |      kernel/io6prom nmi registers      |
  117.  * 0x800  (2k)            +-----------------------------------------+
  118.  *    |      cache error eframe           |
  119.  * 0x400 (1K)              +-----------------------------------------+
  120.  *                         |      Exception Handlers                 |
  121.  * 0x0   (0K)              +-----------------------------------------+
  122.  */
  123. #ifdef LANGUAGE_ASSEMBLY
  124. #define KLDIR_OFF_MAGIC 0x00
  125. #define KLDIR_OFF_OFFSET 0x08
  126. #define KLDIR_OFF_POINTER 0x10
  127. #define KLDIR_OFF_SIZE 0x18
  128. #define KLDIR_OFF_COUNT 0x20
  129. #define KLDIR_OFF_STRIDE 0x28
  130. #endif /* LANGUAGE_ASSEMBLY */
  131. #ifdef _LANGUAGE_C
  132. typedef struct kldir_ent_s {
  133. u64 magic; /* Indicates validity of entry      */
  134. off_t offset; /* Offset from start of node space  */
  135. __psunsigned_t pointer; /* Pointer to area in some cases    */
  136. size_t size; /* Size in bytes      */
  137. u64 count; /* Repeat count if array, 1 if not  */
  138. size_t stride; /* Stride if array, 0 if not        */
  139. char rsvd[16]; /* Pad entry to 0x40 bytes          */
  140. /* NOTE: These 16 bytes are used in the Partition KLDIR
  141.    entry to store partition info. Refer to klpart.h for this. */
  142. } kldir_ent_t;
  143. #endif /* _LANGUAGE_C */
  144. #define KLDIR_ENT_SIZE 0x40
  145. #define KLDIR_MAX_ENTRIES (0x400 / 0x40)
  146. /*
  147.  * The actual offsets of each memory area are machine-dependent
  148.  */
  149. #if defined(CONFIG_SGI_IP35) || defined(CONFIG_IA64_SGI_SN1) || defined(CONFIG_IA64_GENERIC)
  150. #include <asm/sn/sn1/kldir.h>
  151. #else
  152. #error "kldir.h is currently defined for IP27 and IP35 platforms only"
  153. #endif
  154. #endif /* _ASM_SN_KLDIR_H */