home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 2006 November (DVD) / PCWELT_11_2006.ISO / casper / filesystem.squashfs / usr / src / linux-headers-2.6.17-6 / include / asm-mips / sn / kldir.h < prev    next >
Encoding:
C/C++ Source or Header  |  2006-08-11  |  10.4 KB  |  248 lines

  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, 2000 Silicon Graphics, Inc.
  9.  * Copyright (C) 1999, 2000 by Ralf Baechle
  10.  */
  11. #ifndef _ASM_SN_KLDIR_H
  12. #define _ASM_SN_KLDIR_H
  13.  
  14.  
  15. #if defined(CONFIG_SGI_IO)
  16. #include <asm/hack.h>
  17. #endif
  18.  
  19. /*
  20.  * The kldir memory area resides at a fixed place in each node's memory and
  21.  * provides pointers to most other IP27 memory areas.  This allows us to
  22.  * resize and/or relocate memory areas at a later time without breaking all
  23.  * firmware and kernels that use them.  Indices in the array are
  24.  * permanently dedicated to areas listed below.  Some memory areas (marked
  25.  * below) reside at a permanently fixed location, but are included in the
  26.  * directory for completeness.
  27.  */
  28.  
  29. #define KLDIR_MAGIC        0x434d5f53505f5357
  30.  
  31. /*
  32.  * The upper portion of the memory map applies during boot
  33.  * only and is overwritten by IRIX/SYMMON.
  34.  *
  35.  *                                    MEMORY MAP PER NODE
  36.  *
  37.  * 0x2000000 (32M)         +-----------------------------------------+
  38.  *                         |      IO6 BUFFERS FOR FLASH ENET IOC3    |
  39.  * 0x1F80000 (31.5M)       +-----------------------------------------+
  40.  *                         |      IO6 TEXT/DATA/BSS/stack            |
  41.  * 0x1C00000 (30M)         +-----------------------------------------+
  42.  *                         |      IO6 PROM DEBUG TEXT/DATA/BSS/stack |
  43.  * 0x0800000 (28M)         +-----------------------------------------+
  44.  *                         |      IP27 PROM TEXT/DATA/BSS/stack      |
  45.  * 0x1B00000 (27M)         +-----------------------------------------+
  46.  *                         |      IP27 CFG                           |
  47.  * 0x1A00000 (26M)         +-----------------------------------------+
  48.  *                         |      Graphics PROM                      |
  49.  * 0x1800000 (24M)         +-----------------------------------------+
  50.  *                         |      3rd Party PROM drivers             |
  51.  * 0x1600000 (22M)         +-----------------------------------------+
  52.  *                         |                                         |
  53.  *                         |      Free                               |
  54.  *                         |                                         |
  55.  *                         +-----------------------------------------+
  56.  *                         |      UNIX DEBUG Version                 |
  57.  * 0x190000 (2M--)         +-----------------------------------------+
  58.  *                         |      SYMMON                             |
  59.  *                         |      (For UNIX Debug only)              |
  60.  * 0x34000 (208K)          +-----------------------------------------+
  61.  *                         |      SYMMON STACK [NUM_CPU_PER_NODE]    |
  62.  *                         |      (For UNIX Debug only)              |
  63.  * 0x25000 (148K)          +-----------------------------------------+
  64.  *                         |      KLCONFIG - II (temp)               |
  65.  *                         |                                         |
  66.  *                         |    ----------------------------         |
  67.  *                         |                                         |
  68.  *                         |      UNIX NON-DEBUG Version             |
  69.  * 0x19000 (100K)          +-----------------------------------------+
  70.  *
  71.  *
  72.  * The lower portion of the memory map contains information that is
  73.  * permanent and is used by the IP27PROM, IO6PROM and IRIX.
  74.  *
  75.  * 0x19000 (100K)          +-----------------------------------------+
  76.  *                         |                                         |
  77.  *                         |      PI Error Spools (32K)              |
  78.  *                         |                                         |
  79.  * 0x12000 (72K)           +-----------------------------------------+
  80.  *                         |      Unused                             |
  81.  * 0x11c00 (71K)           +-----------------------------------------+
  82.  *                         |      CPU 1 NMI Eframe area                |
  83.  * 0x11a00 (70.5K)         +-----------------------------------------+
  84.  *                         |      CPU 0 NMI Eframe area                |
  85.  * 0x11800 (70K)           +-----------------------------------------+
  86.  *                         |      CPU 1 NMI Register save area       |
  87.  * 0x11600 (69.5K)         +-----------------------------------------+
  88.  *                         |      CPU 0 NMI Register save area       |
  89.  * 0x11400 (69K)           +-----------------------------------------+
  90.  *                         |      GDA (1k)                           |
  91.  * 0x11000 (68K)           +-----------------------------------------+
  92.  *                         |      Early cache Exception stack        |
  93.  *                         |             and/or                      |
  94.  *               |      kernel/io6prom nmi registers         |
  95.  * 0x10800  (66k)       +-----------------------------------------+
  96.  *               |      cache error eframe                 |
  97.  * 0x10400 (65K)           +-----------------------------------------+
  98.  *                         |      Exception Handlers (UALIAS copy)   |
  99.  * 0x10000 (64K)           +-----------------------------------------+
  100.  *                         |                                         |
  101.  *                         |                                         |
  102.  *                         |      KLCONFIG - I (permanent) (48K)     |
  103.  *                         |                                         |
  104.  *                         |                                         |
  105.  *                         |                                         |
  106.  * 0x4000 (16K)            +-----------------------------------------+
  107.  *                         |      NMI Handler (Protected Page)       |
  108.  * 0x3000 (12K)            +-----------------------------------------+
  109.  *                         |      ARCS PVECTORS (master node only)   |
  110.  * 0x2c00 (11K)            +-----------------------------------------+
  111.  *                         |      ARCS TVECTORS (master node only)   |
  112.  * 0x2800 (10K)            +-----------------------------------------+
  113.  *                         |      LAUNCH [NUM_CPU]                   |
  114.  * 0x2400 (9K)             +-----------------------------------------+
  115.  *                         |      Low memory directory (KLDIR)       |
  116.  * 0x2000 (8K)             +-----------------------------------------+
  117.  *                         |      ARCS SPB (1K)                      |
  118.  * 0x1000 (4K)             +-----------------------------------------+
  119.  *                         |      Early cache Exception stack        |
  120.  *                         |             and/or                      |
  121.  *               |      kernel/io6prom nmi registers         |
  122.  * 0x800  (2k)               +-----------------------------------------+
  123.  *               |      cache error eframe                 |
  124.  * 0x400 (1K)              +-----------------------------------------+
  125.  *                         |      Exception Handlers                 |
  126.  * 0x0   (0K)              +-----------------------------------------+
  127.  */
  128.  
  129. #ifdef __ASSEMBLY__
  130. #define KLDIR_OFF_MAGIC            0x00
  131. #define KLDIR_OFF_OFFSET        0x08
  132. #define KLDIR_OFF_POINTER        0x10
  133. #define KLDIR_OFF_SIZE            0x18
  134. #define KLDIR_OFF_COUNT            0x20
  135. #define KLDIR_OFF_STRIDE        0x28
  136. #endif /* __ASSEMBLY__ */
  137.  
  138. #if !defined(CONFIG_SGI_IO)
  139.  
  140. /*
  141.  * This is defined here because IP27_SYMMON_STK_SIZE must be at least what
  142.  * we define here.  Since it's set up in the prom.  We can't redefine it later
  143.  * and expect more space to be allocated.  The way to find out the true size
  144.  * of the symmon stacks is to divide SYMMON_STK_SIZE by SYMMON_STK_STRIDE
  145.  * for a particular node.
  146.  */
  147. #define SYMMON_STACK_SIZE        0x8000
  148.  
  149. #if defined (PROM) || defined (SABLE)
  150.  
  151. /*
  152.  * These defines are prom version dependent.  No code other than the IP27
  153.  * prom should attempt to use these values.
  154.  */
  155. #define IP27_LAUNCH_OFFSET        0x2400
  156. #define IP27_LAUNCH_SIZE        0x400
  157. #define IP27_LAUNCH_COUNT        2
  158. #define IP27_LAUNCH_STRIDE        0x200
  159.  
  160. #define IP27_KLCONFIG_OFFSET        0x4000
  161. #define IP27_KLCONFIG_SIZE        0xc000
  162. #define IP27_KLCONFIG_COUNT        1
  163. #define IP27_KLCONFIG_STRIDE        0
  164.  
  165. #define IP27_NMI_OFFSET            0x3000
  166. #define IP27_NMI_SIZE            0x40
  167. #define IP27_NMI_COUNT            2
  168. #define IP27_NMI_STRIDE            0x40
  169.  
  170. #define IP27_PI_ERROR_OFFSET        0x12000
  171. #define IP27_PI_ERROR_SIZE        0x4000
  172. #define IP27_PI_ERROR_COUNT        1
  173. #define IP27_PI_ERROR_STRIDE        0
  174.  
  175. #define IP27_SYMMON_STK_OFFSET        0x25000
  176. #define IP27_SYMMON_STK_SIZE        0xe000
  177. #define IP27_SYMMON_STK_COUNT        2
  178. /* IP27_SYMMON_STK_STRIDE must be >= SYMMON_STACK_SIZE */
  179. #define IP27_SYMMON_STK_STRIDE        0x7000
  180.  
  181. #define IP27_FREEMEM_OFFSET        0x19000
  182. #define IP27_FREEMEM_SIZE        -1
  183. #define IP27_FREEMEM_COUNT        1
  184. #define IP27_FREEMEM_STRIDE        0
  185.  
  186. #endif /* PROM || SABLE*/
  187. /*
  188.  * There will be only one of these in a partition so the IO6 must set it up.
  189.  */
  190. #define IO6_GDA_OFFSET            0x11000
  191. #define IO6_GDA_SIZE            0x400
  192. #define IO6_GDA_COUNT            1
  193. #define IO6_GDA_STRIDE            0
  194.  
  195. /*
  196.  * save area of kernel nmi regs in the prom format
  197.  */
  198. #define IP27_NMI_KREGS_OFFSET        0x11400
  199. #define IP27_NMI_KREGS_CPU_SIZE        0x200
  200. /*
  201.  * save area of kernel nmi regs in eframe format
  202.  */
  203. #define IP27_NMI_EFRAME_OFFSET        0x11800
  204. #define IP27_NMI_EFRAME_SIZE        0x200
  205.  
  206. #define KLDIR_ENT_SIZE            0x40
  207. #define KLDIR_MAX_ENTRIES        (0x400 / 0x40)
  208.  
  209. #endif    /* !CONFIG_SGI_IO */
  210.  
  211. #ifndef __ASSEMBLY__
  212. typedef struct kldir_ent_s {
  213.     u64        magic;        /* Indicates validity of entry      */
  214.     off_t        offset;        /* Offset from start of node space  */
  215. #if defined(CONFIG_SGI_IO)    /* FIXME */
  216.     __psunsigned_t    pointer;    /* Pointer to area in some cases    */
  217. #else
  218.     unsigned long    pointer;    /* Pointer to area in some cases    */
  219. #endif
  220.     size_t        size;        /* Size in bytes             */
  221.     u64        count;        /* Repeat count if array, 1 if not  */
  222.     size_t        stride;        /* Stride if array, 0 if not        */
  223.     char        rsvd[16];    /* Pad entry to 0x40 bytes          */
  224.     /* NOTE: These 16 bytes are used in the Partition KLDIR
  225.        entry to store partition info. Refer to klpart.h for this. */
  226. } kldir_ent_t;
  227. #endif /* !__ASSEMBLY__ */
  228.  
  229. #if defined(CONFIG_SGI_IO)
  230.  
  231. #define KLDIR_ENT_SIZE            0x40
  232. #define KLDIR_MAX_ENTRIES        (0x400 / 0x40)
  233.  
  234. /*
  235.  * The actual offsets of each memory area are machine-dependent
  236.  */
  237. #ifdef CONFIG_SGI_IP27
  238. // Not yet #include <asm/sn/sn0/kldir.h>
  239. #elif defined(CONFIG_SGI_IP35)
  240. #include <asm/sn/sn1/kldir.h>
  241. #else
  242. #error "kldir.h is currently defined for IP27 and IP35 platforms only"
  243. #endif
  244.  
  245. #endif    /* CONFIG_SGI_IO */
  246.  
  247. #endif /* _ASM_SN_KLDIR_H */
  248.