Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros
addrs.h File Reference
#include <asm/percpu.h>
#include <asm/sn/types.h>
#include <asm/sn/arch.h>
#include <asm/sn/pda.h>

Go to the source code of this file.

Macros

#define NASID_BITMASK   (sn_hub_info->nasid_bitmask)
 
#define NASID_SHIFT   (sn_hub_info->nasid_shift)
 
#define AS_SHIFT   (sn_hub_info->as_shift)
 
#define AS_BITMASK   0x3UL
 
#define NASID_MASK   ((u64)NASID_BITMASK << NASID_SHIFT)
 
#define AS_MASK   ((u64)AS_BITMASK << AS_SHIFT)
 
#define AS_GET_VAL   1UL
 
#define AS_AMO_VAL   2UL
 
#define AS_CAC_VAL   3UL
 
#define AS_GET_SPACE   (AS_GET_VAL << AS_SHIFT)
 
#define AS_AMO_SPACE   (AS_AMO_VAL << AS_SHIFT)
 
#define AS_CAC_SPACE   (AS_CAC_VAL << AS_SHIFT)
 
#define SH1_LOCAL_MMR_OFFSET   0x8000000000UL
 
#define SH2_LOCAL_MMR_OFFSET   0x0200000000UL
 
#define LOCAL_MMR_OFFSET   (is_shub2() ? SH2_LOCAL_MMR_OFFSET : SH1_LOCAL_MMR_OFFSET)
 
#define LOCAL_MMR_SPACE   (__IA64_UNCACHED_OFFSET | LOCAL_MMR_OFFSET)
 
#define LOCAL_PHYS_MMR_SPACE   (RGN_BASE(RGN_HPAGE) | LOCAL_MMR_OFFSET)
 
#define SH1_GLOBAL_MMR_OFFSET   0x0800000000UL
 
#define SH2_GLOBAL_MMR_OFFSET   0x0300000000UL
 
#define GLOBAL_MMR_OFFSET   (is_shub2() ? SH2_GLOBAL_MMR_OFFSET : SH1_GLOBAL_MMR_OFFSET)
 
#define GLOBAL_MMR_SPACE   (__IA64_UNCACHED_OFFSET | GLOBAL_MMR_OFFSET)
 
#define GLOBAL_PHYS_MMR_SPACE   (RGN_BASE(RGN_HPAGE) | GLOBAL_MMR_OFFSET)
 
#define TO_PHYS_MASK   (~(RGN_BITS | AS_MASK))
 
#define NASID_SPACE(n)   ((u64)(n) << NASID_SHIFT)
 
#define REMOTE_ADDR(n, a)   (NASID_SPACE(n) | (a))
 
#define NODE_OFFSET(x)   ((x) & (NODE_ADDRSPACE_SIZE - 1))
 
#define NODE_ADDRSPACE_SIZE   (1UL << AS_SHIFT)
 
#define NASID_GET(x)   (int) (((u64) (x) >> NASID_SHIFT) & NASID_BITMASK)
 
#define LOCAL_MMR_ADDR(a)   (LOCAL_MMR_SPACE | (a))
 
#define GLOBAL_MMR_ADDR(n, a)   (GLOBAL_MMR_SPACE | REMOTE_ADDR(n,a))
 
#define GLOBAL_MMR_PHYS_ADDR(n, a)   (GLOBAL_PHYS_MMR_SPACE | REMOTE_ADDR(n,a))
 
#define GLOBAL_CAC_ADDR(n, a)   (CAC_BASE | REMOTE_ADDR(n,a))
 
#define CHANGE_NASID(n, x)   ((void *)(((u64)(x) & ~NASID_MASK) | NASID_SPACE(n)))
 
#define IS_TIO_NASID(n)   ((n) & 1)
 
#define BWIN_TOP   0x0000000100000000UL
 
#define CAC_BASE   (PAGE_OFFSET | AS_CAC_SPACE)
 
#define AMO_BASE   (__IA64_UNCACHED_OFFSET | AS_AMO_SPACE)
 
#define AMO_PHYS_BASE   (RGN_BASE(RGN_HPAGE) | AS_AMO_SPACE)
 
#define GET_BASE   (PAGE_OFFSET | AS_GET_SPACE)
 
#define TO_PHYS(x)   (TO_PHYS_MASK & (x))
 
#define TO_CAC(x)   (CAC_BASE | TO_PHYS(x))
 
#define TO_AMO(x)   ({ BUG(); x; })
 
#define TO_GET(x)   ({ BUG(); x; })
 
#define SH1_TIO_PHYS_TO_DMA(x)   ((((u64)(NASID_GET(x))) << 40) | NODE_OFFSET(x))
 
#define SH2_NETWORK_BANK_OFFSET(x)   ((u64)(x) & ((1UL << (sn_hub_info->nasid_shift - 4)) -1))
 
#define SH2_NETWORK_BANK_SELECT(x)
 
#define SH2_NETWORK_ADDRESS(x)   (SH2_NETWORK_BANK_OFFSET(x) | SH2_NETWORK_BANK_SELECT(x))
 
#define SH2_TIO_PHYS_TO_DMA(x)   (((u64)(NASID_GET(x)) << 40) | SH2_NETWORK_ADDRESS(x))
 
#define PHYS_TO_TIODMA(x)   (is_shub1() ? SH1_TIO_PHYS_TO_DMA(x) : SH2_TIO_PHYS_TO_DMA(x))
 
#define PHYS_TO_DMA(x)   ((((u64)(x) & NASID_MASK) >> 2) | NODE_OFFSET(x))
 
#define IS_AMO_ADDRESS(x)   (((u64)(x) & (RGN_BITS | AS_MASK)) == AMO_BASE)
 
#define IS_AMO_PHYS_ADDRESS(x)   (((u64)(x) & (RGN_BITS | AS_MASK)) == AMO_PHYS_BASE)
 
#define BWIN_SIZE_BITS   29 /* big window size: 512M */
 
#define TIO_BWIN_SIZE_BITS   30 /* big window size: 1G */
 
#define NODE_SWIN_BASE(n, w)
 
#define TIO_SWIN_BASE(n, w)
 
#define NODE_IO_BASE(n)   (GLOBAL_MMR_SPACE | NASID_SPACE(n))
 
#define TIO_IO_BASE(n)   (__IA64_UNCACHED_OFFSET | NASID_SPACE(n))
 
#define BWIN_SIZE   (1UL << BWIN_SIZE_BITS)
 
#define NODE_BWIN_BASE0(n)   (NODE_IO_BASE(n) + BWIN_SIZE)
 
#define NODE_BWIN_BASE(n, w)   (NODE_BWIN_BASE0(n) + ((u64) (w) << BWIN_SIZE_BITS))
 
#define RAW_NODE_SWIN_BASE(n, w)   (NODE_IO_BASE(n) + ((u64) (w) << SWIN_SIZE_BITS))
 
#define BWIN_WIDGET_MASK   0x7
 
#define BWIN_WINDOWNUM(x)   (((x) >> BWIN_SIZE_BITS) & BWIN_WIDGET_MASK)
 
#define SH1_IS_BIG_WINDOW_ADDR(x)   ((x) & BWIN_TOP)
 
#define TIO_BWIN_WINDOW_SELECT_MASK   0x7
 
#define TIO_BWIN_WINDOWNUM(x)   (((x) >> TIO_BWIN_SIZE_BITS) & TIO_BWIN_WINDOW_SELECT_MASK)
 
#define TIO_HWIN_SHIFT_BITS   33
 
#define TIO_HWIN(x)   (NODE_OFFSET(x) >> TIO_HWIN_SHIFT_BITS)
 
#define SWIN_SIZE_BITS   24
 
#define SWIN_WIDGET_MASK   0xF
 
#define TIO_SWIN_SIZE_BITS   28
 
#define TIO_SWIN_SIZE   (1UL << TIO_SWIN_SIZE_BITS)
 
#define TIO_SWIN_WIDGET_MASK   0x3
 
#define SWIN_WIDGETNUM(x)   (((x) >> SWIN_SIZE_BITS) & SWIN_WIDGET_MASK)
 
#define TIO_SWIN_WIDGETNUM(x)   (((x) >> TIO_SWIN_SIZE_BITS) & TIO_SWIN_WIDGET_MASK)
 
#define SH1_TIO_IOSPACE_ADDR(n, x)   GLOBAL_MMR_ADDR(n,x)
 
#define SH1_REMOTE_BWIN_MMR(n, x)   GLOBAL_MMR_ADDR(n,x)
 
#define SH1_REMOTE_SWIN_MMR(n, x)   (NODE_SWIN_BASE(n,1) + 0x800000UL + (x))
 
#define SH1_REMOTE_MMR(n, x)
 
#define SH2_TIO_IOSPACE_ADDR(n, x)   ((__IA64_UNCACHED_OFFSET | REMOTE_ADDR(n,x) | 1UL << (NASID_SHIFT - 2)))
 
#define SH2_REMOTE_MMR(n, x)   GLOBAL_MMR_ADDR(n,x)
 
#define TIO_IOSPACE_ADDR(n, x)
 
#define SH_REMOTE_MMR(n, x)   (is_shub1() ? SH1_REMOTE_MMR(n,x) : SH2_REMOTE_MMR(n,x))
 
#define REMOTE_HUB_ADDR(n, x)
 
#define HUB_L(x)   (*((volatile typeof(*x) *)x))
 
#define HUB_S(x, d)   (*((volatile typeof(*x) *)x) = (d))
 
#define REMOTE_HUB_L(n, a)   HUB_L(REMOTE_HUB_ADDR((n), (a)))
 
#define REMOTE_HUB_S(n, a, d)   HUB_S(REMOTE_HUB_ADDR((n), (a)), (d))
 
#define CTALK_NASID_SHFT   40
 
#define CTALK_NASID_MASK   (0x3FFFULL << CTALK_NASID_SHFT)
 
#define CTALK_CID_SHFT   38
 
#define CTALK_CID_MASK   (0x3ULL << CTALK_CID_SHFT)
 
#define CTALK_NODE_OFFSET   0x3FFFFFFFFF
 

Macro Definition Documentation

#define AMO_BASE   (__IA64_UNCACHED_OFFSET | AS_AMO_SPACE)

Definition at line 130 of file addrs.h.

#define AMO_PHYS_BASE   (RGN_BASE(RGN_HPAGE) | AS_AMO_SPACE)

Definition at line 131 of file addrs.h.

#define AS_AMO_SPACE   (AS_AMO_VAL << AS_SHIFT)

Definition at line 77 of file addrs.h.

#define AS_AMO_VAL   2UL

Definition at line 74 of file addrs.h.

#define AS_BITMASK   0x3UL

Definition at line 64 of file addrs.h.

#define AS_CAC_SPACE   (AS_CAC_VAL << AS_SHIFT)

Definition at line 78 of file addrs.h.

#define AS_CAC_VAL   3UL

Definition at line 75 of file addrs.h.

#define AS_GET_SPACE   (AS_GET_VAL << AS_SHIFT)

Definition at line 76 of file addrs.h.

#define AS_GET_VAL   1UL

Definition at line 73 of file addrs.h.

#define AS_MASK   ((u64)AS_BITMASK << AS_SHIFT)

Definition at line 67 of file addrs.h.

#define AS_SHIFT   (sn_hub_info->as_shift)

Definition at line 63 of file addrs.h.

#define BWIN_SIZE   (1UL << BWIN_SIZE_BITS)

Definition at line 198 of file addrs.h.

#define BWIN_SIZE_BITS   29 /* big window size: 512M */

Definition at line 190 of file addrs.h.

#define BWIN_TOP   0x0000000100000000UL

Definition at line 124 of file addrs.h.

#define BWIN_WIDGET_MASK   0x7

Definition at line 202 of file addrs.h.

#define BWIN_WINDOWNUM (   x)    (((x) >> BWIN_SIZE_BITS) & BWIN_WIDGET_MASK)

Definition at line 203 of file addrs.h.

#define CAC_BASE   (PAGE_OFFSET | AS_CAC_SPACE)

Definition at line 129 of file addrs.h.

#define CHANGE_NASID (   n,
  x 
)    ((void *)(((u64)(x) & ~NASID_MASK) | NASID_SPACE(n)))

Definition at line 119 of file addrs.h.

#define CTALK_CID_MASK   (0x3ULL << CTALK_CID_SHFT)

Definition at line 296 of file addrs.h.

#define CTALK_CID_SHFT   38

Definition at line 295 of file addrs.h.

#define CTALK_NASID_MASK   (0x3FFFULL << CTALK_NASID_SHFT)

Definition at line 294 of file addrs.h.

#define CTALK_NASID_SHFT   40

Definition at line 293 of file addrs.h.

#define CTALK_NODE_OFFSET   0x3FFFFFFFFF

Definition at line 297 of file addrs.h.

#define GET_BASE   (PAGE_OFFSET | AS_GET_SPACE)

Definition at line 132 of file addrs.h.

#define GLOBAL_CAC_ADDR (   n,
  a 
)    (CAC_BASE | REMOTE_ADDR(n,a))

Definition at line 118 of file addrs.h.

#define GLOBAL_MMR_ADDR (   n,
  a 
)    (GLOBAL_MMR_SPACE | REMOTE_ADDR(n,a))

Definition at line 116 of file addrs.h.

#define GLOBAL_MMR_OFFSET   (is_shub2() ? SH2_GLOBAL_MMR_OFFSET : SH1_GLOBAL_MMR_OFFSET)

Definition at line 92 of file addrs.h.

#define GLOBAL_MMR_PHYS_ADDR (   n,
  a 
)    (GLOBAL_PHYS_MMR_SPACE | REMOTE_ADDR(n,a))

Definition at line 117 of file addrs.h.

#define GLOBAL_MMR_SPACE   (__IA64_UNCACHED_OFFSET | GLOBAL_MMR_OFFSET)

Definition at line 93 of file addrs.h.

#define GLOBAL_PHYS_MMR_SPACE   (RGN_BASE(RGN_HPAGE) | GLOBAL_MMR_OFFSET)

Definition at line 98 of file addrs.h.

#define HUB_L (   x)    (*((volatile typeof(*x) *)x))

Definition at line 284 of file addrs.h.

#define HUB_S (   x,
  d 
)    (*((volatile typeof(*x) *)x) = (d))

Definition at line 285 of file addrs.h.

#define IS_AMO_ADDRESS (   x)    (((u64)(x) & (RGN_BITS | AS_MASK)) == AMO_BASE)

Definition at line 181 of file addrs.h.

#define IS_AMO_PHYS_ADDRESS (   x)    (((u64)(x) & (RGN_BITS | AS_MASK)) == AMO_PHYS_BASE)

Definition at line 182 of file addrs.h.

#define IS_TIO_NASID (   n)    ((n) & 1)

Definition at line 120 of file addrs.h.

#define LOCAL_MMR_ADDR (   a)    (LOCAL_MMR_SPACE | (a))

Definition at line 115 of file addrs.h.

#define LOCAL_MMR_OFFSET   (is_shub2() ? SH2_LOCAL_MMR_OFFSET : SH1_LOCAL_MMR_OFFSET)

Definition at line 86 of file addrs.h.

#define LOCAL_MMR_SPACE   (__IA64_UNCACHED_OFFSET | LOCAL_MMR_OFFSET)

Definition at line 87 of file addrs.h.

#define LOCAL_PHYS_MMR_SPACE   (RGN_BASE(RGN_HPAGE) | LOCAL_MMR_OFFSET)

Definition at line 88 of file addrs.h.

#define NASID_BITMASK   (sn_hub_info->nasid_bitmask)

Definition at line 61 of file addrs.h.

#define NASID_GET (   x)    (int) (((u64) (x) >> NASID_SHIFT) & NASID_BITMASK)

Definition at line 114 of file addrs.h.

#define NASID_MASK   ((u64)NASID_BITMASK << NASID_SHIFT)

Definition at line 66 of file addrs.h.

#define NASID_SHIFT   (sn_hub_info->nasid_shift)

Definition at line 62 of file addrs.h.

#define NASID_SPACE (   n)    ((u64)(n) << NASID_SHIFT)

Definition at line 110 of file addrs.h.

#define NODE_ADDRSPACE_SIZE   (1UL << AS_SHIFT)

Definition at line 113 of file addrs.h.

#define NODE_BWIN_BASE (   n,
  w 
)    (NODE_BWIN_BASE0(n) + ((u64) (w) << BWIN_SIZE_BITS))

Definition at line 200 of file addrs.h.

#define NODE_BWIN_BASE0 (   n)    (NODE_IO_BASE(n) + BWIN_SIZE)

Definition at line 199 of file addrs.h.

#define NODE_IO_BASE (   n)    (GLOBAL_MMR_SPACE | NASID_SPACE(n))

Definition at line 196 of file addrs.h.

#define NODE_OFFSET (   x)    ((x) & (NODE_ADDRSPACE_SIZE - 1))

Definition at line 112 of file addrs.h.

#define NODE_SWIN_BASE (   n,
  w 
)
Value:

Definition at line 192 of file addrs.h.

#define PHYS_TO_DMA (   x)    ((((u64)(x) & NASID_MASK) >> 2) | NODE_OFFSET(x))

Definition at line 174 of file addrs.h.

#define PHYS_TO_TIODMA (   x)    (is_shub1() ? SH1_TIO_PHYS_TO_DMA(x) : SH2_TIO_PHYS_TO_DMA(x))

Definition at line 171 of file addrs.h.

#define RAW_NODE_SWIN_BASE (   n,
  w 
)    (NODE_IO_BASE(n) + ((u64) (w) << SWIN_SIZE_BITS))

Definition at line 201 of file addrs.h.

#define REMOTE_ADDR (   n,
  a 
)    (NASID_SPACE(n) | (a))

Definition at line 111 of file addrs.h.

#define REMOTE_HUB_ADDR (   n,
  x 
)
Value:
(IS_TIO_NASID(n) ? ((volatile u64*)TIO_IOSPACE_ADDR(n,x)) : \
((volatile u64*)SH_REMOTE_MMR(n,x)))

Definition at line 279 of file addrs.h.

#define REMOTE_HUB_L (   n,
  a 
)    HUB_L(REMOTE_HUB_ADDR((n), (a)))

Definition at line 287 of file addrs.h.

#define REMOTE_HUB_S (   n,
  a,
  d 
)    HUB_S(REMOTE_HUB_ADDR((n), (a)), (d))

Definition at line 288 of file addrs.h.

#define SH1_GLOBAL_MMR_OFFSET   0x0800000000UL

Definition at line 90 of file addrs.h.

#define SH1_IS_BIG_WINDOW_ADDR (   x)    ((x) & BWIN_TOP)

Definition at line 204 of file addrs.h.

#define SH1_LOCAL_MMR_OFFSET   0x8000000000UL

Definition at line 84 of file addrs.h.

#define SH1_REMOTE_BWIN_MMR (   n,
  x 
)    GLOBAL_MMR_ADDR(n,x)

Definition at line 253 of file addrs.h.

#define SH1_REMOTE_MMR (   n,
  x 
)
Value:

Definition at line 259 of file addrs.h.

#define SH1_REMOTE_SWIN_MMR (   n,
  x 
)    (NODE_SWIN_BASE(n,1) + 0x800000UL + (x))

Definition at line 256 of file addrs.h.

#define SH1_TIO_IOSPACE_ADDR (   n,
  x 
)    GLOBAL_MMR_ADDR(n,x)

Definition at line 250 of file addrs.h.

#define SH1_TIO_PHYS_TO_DMA (   x)    ((((u64)(NASID_GET(x))) << 40) | NODE_OFFSET(x))

Definition at line 155 of file addrs.h.

#define SH2_GLOBAL_MMR_OFFSET   0x0300000000UL

Definition at line 91 of file addrs.h.

#define SH2_LOCAL_MMR_OFFSET   0x0200000000UL

Definition at line 85 of file addrs.h.

#define SH2_NETWORK_ADDRESS (   x)    (SH2_NETWORK_BANK_OFFSET(x) | SH2_NETWORK_BANK_SELECT(x))

Definition at line 165 of file addrs.h.

#define SH2_NETWORK_BANK_OFFSET (   x)    ((u64)(x) & ((1UL << (sn_hub_info->nasid_shift - 4)) -1))

Definition at line 158 of file addrs.h.

#define SH2_NETWORK_BANK_SELECT (   x)
Value:
((((u64)(x) & (0x3UL << (sn_hub_info->nasid_shift - 4))) \
>> (sn_hub_info->nasid_shift - 4)) << 36)

Definition at line 161 of file addrs.h.

#define SH2_REMOTE_MMR (   n,
  x 
)    GLOBAL_MMR_ADDR(n,x)

Definition at line 267 of file addrs.h.

#define SH2_TIO_IOSPACE_ADDR (   n,
  x 
)    ((__IA64_UNCACHED_OFFSET | REMOTE_ADDR(n,x) | 1UL << (NASID_SHIFT - 2)))

Definition at line 264 of file addrs.h.

#define SH2_TIO_PHYS_TO_DMA (   x)    (((u64)(NASID_GET(x)) << 40) | SH2_NETWORK_ADDRESS(x))

Definition at line 168 of file addrs.h.

#define SH_REMOTE_MMR (   n,
  x 
)    (is_shub1() ? SH1_REMOTE_MMR(n,x) : SH2_REMOTE_MMR(n,x))

Definition at line 276 of file addrs.h.

#define SWIN_SIZE_BITS   24

Definition at line 218 of file addrs.h.

#define SWIN_WIDGET_MASK   0xF

Definition at line 219 of file addrs.h.

#define SWIN_WIDGETNUM (   x)    (((x) >> SWIN_SIZE_BITS) & SWIN_WIDGET_MASK)

Definition at line 231 of file addrs.h.

#define TIO_BWIN_SIZE_BITS   30 /* big window size: 1G */

Definition at line 191 of file addrs.h.

#define TIO_BWIN_WINDOW_SELECT_MASK   0x7

Definition at line 206 of file addrs.h.

#define TIO_BWIN_WINDOWNUM (   x)    (((x) >> TIO_BWIN_SIZE_BITS) & TIO_BWIN_WINDOW_SELECT_MASK)

Definition at line 207 of file addrs.h.

#define TIO_HWIN (   x)    (NODE_OFFSET(x) >> TIO_HWIN_SHIFT_BITS)

Definition at line 210 of file addrs.h.

#define TIO_HWIN_SHIFT_BITS   33

Definition at line 209 of file addrs.h.

#define TIO_IO_BASE (   n)    (__IA64_UNCACHED_OFFSET | NASID_SPACE(n))

Definition at line 197 of file addrs.h.

#define TIO_IOSPACE_ADDR (   n,
  x 
)
Value:

Definition at line 272 of file addrs.h.

#define TIO_SWIN_BASE (   n,
  w 
)
Value:

Definition at line 194 of file addrs.h.

#define TIO_SWIN_SIZE   (1UL << TIO_SWIN_SIZE_BITS)

Definition at line 222 of file addrs.h.

#define TIO_SWIN_SIZE_BITS   28

Definition at line 221 of file addrs.h.

#define TIO_SWIN_WIDGET_MASK   0x3

Definition at line 223 of file addrs.h.

#define TIO_SWIN_WIDGETNUM (   x)    (((x) >> TIO_SWIN_SIZE_BITS) & TIO_SWIN_WIDGET_MASK)

Definition at line 232 of file addrs.h.

#define TO_AMO (   x)    ({ BUG(); x; })

Definition at line 143 of file addrs.h.

#define TO_CAC (   x)    (CAC_BASE | TO_PHYS(x))

Definition at line 138 of file addrs.h.

#define TO_GET (   x)    ({ BUG(); x; })

Definition at line 144 of file addrs.h.

#define TO_PHYS (   x)    (TO_PHYS_MASK & (x))

Definition at line 137 of file addrs.h.

#define TO_PHYS_MASK   (~(RGN_BITS | AS_MASK))

Definition at line 104 of file addrs.h.