4f050825eeadfeded2323007c902fc41cc43f253
[linux-flexiantxendom0-3.2.10.git] / include / asm-ia64 / sn / sgi.h
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  * Copyright (C) 2000-2003 Silicon Graphics, Inc. All rights reserved.
7  */
8
9
10 #ifndef _ASM_IA64_SN_SGI_H
11 #define _ASM_IA64_SN_SGI_H
12
13 #include <linux/config.h>
14
15 #include <asm/sn/types.h>
16 #include <asm/uaccess.h>                /* for copy_??_user */
17 #include <asm/sn/hwgfs.h>
18
19 typedef hwgfs_handle_t vertex_hdl_t;
20
21 /* Nice general name length that lots of people like to use */
22 #ifndef MAXDEVNAME
23 #define MAXDEVNAME 256
24 #endif
25
26
27 /*
28  * Possible return values from graph routines.
29  */
30 typedef enum graph_error_e {
31         GRAPH_SUCCESS,          /* 0 */
32         GRAPH_DUP,              /* 1 */
33         GRAPH_NOT_FOUND,        /* 2 */
34         GRAPH_BAD_PARAM,        /* 3 */
35         GRAPH_HIT_LIMIT,        /* 4 */
36         GRAPH_CANNOT_ALLOC,     /* 5 */
37         GRAPH_ILLEGAL_REQUEST,  /* 6 */
38         GRAPH_IN_USE            /* 7 */
39 } graph_error_t;
40
41 #define CNODEID_NONE ((cnodeid_t)-1)
42 #define CPU_NONE                (-1)
43 #define GRAPH_VERTEX_NONE ((vertex_hdl_t)-1)
44
45 /*
46  * Defines for individual WARs. Each is a bitmask of applicable
47  * part revision numbers. (1 << 1) == rev A, (1 << 2) == rev B,
48  * (3 << 1) == (rev A or rev B), etc
49  */
50 #define PV854697 (~0)     /* PIC: write 64bit regs as 64bits. permanent */
51 #define PV854827 (~0UL)   /* PIC: fake widget 0xf presence bit. permanent */
52 #define PV855271 (1 << 1) /* PIC: use virt chan iff 64-bit device. */
53 #define PV878674 (~0)     /* PIC: Dont allow 64bit PIOs.  permanent */
54 #define PV855272 (1 << 1) /* PIC: runaway interrupt WAR */
55 #define PV856155 (1 << 1) /* PIC: arbitration WAR */
56 #define PV856864 (1 << 1) /* PIC: lower timeout to free TNUMs quicker */
57 #define PV856866 (1 << 1) /* PIC: avoid rrb's 0/1/8/9. */
58 #define PV862253 (1 << 1) /* PIC: don't enable write req RAM parity checking */
59 #define PV867308 (3 << 1) /* PIC: make LLP error interrupts FATAL for PIC */
60
61 /*
62  * No code is complete without an Assertion macro
63  */
64
65 #if defined(DISABLE_ASSERT)
66 #define ASSERT(expr)
67 #define ASSERT_ALWAYS(expr)
68 #else
69 #define ASSERT(expr)  do {      \
70         if(!(expr)) { \
71                 printk( "Assertion [%s] failed! %s:%s(line=%d)\n",\
72                         #expr,__FILE__,__FUNCTION__,__LINE__); \
73                 panic("Assertion panic\n");     \
74         } } while(0)
75
76 #define ASSERT_ALWAYS(expr)     do {\
77         if(!(expr)) { \
78                 printk( "Assertion [%s] failed! %s:%s(line=%d)\n",\
79                         #expr,__FILE__,__FUNCTION__,__LINE__); \
80                 panic("Assertion always panic\n");      \
81         } } while(0)
82 #endif  /* DISABLE_ASSERT */
83
84 #endif /* _ASM_IA64_SN_SGI_H */