diff options
author | Dean Nelson <dcn@sgi.com> | 2008-07-30 01:34:14 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-07-30 12:41:50 -0400 |
commit | 04de741885bc7565a28150e82c56a56e544440e6 (patch) | |
tree | 7c955e1d9dbe4c7d319818f48e22ef85113b2c2f /drivers/misc/sgi-xp/xpc.h | |
parent | ea57f80c8c0e59cfc5095f7e856ce7c8e6ac2984 (diff) |
sgi-xp: use standard bitops macros and functions
Change sgi-xp to use the standard bitops macros and functions instead of
trying to invent its own mechanism.
Signed-off-by: Dean Nelson <dcn@sgi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers/misc/sgi-xp/xpc.h')
-rw-r--r-- | drivers/misc/sgi-xp/xpc.h | 43 |
1 files changed, 15 insertions, 28 deletions
diff --git a/drivers/misc/sgi-xp/xpc.h b/drivers/misc/sgi-xp/xpc.h index 0f516c3e3e61..0907934cdd8f 100644 --- a/drivers/misc/sgi-xp/xpc.h +++ b/drivers/misc/sgi-xp/xpc.h | |||
@@ -35,23 +35,7 @@ | |||
35 | #define XPC_VERSION_MAJOR(_v) ((_v) >> 4) | 35 | #define XPC_VERSION_MAJOR(_v) ((_v) >> 4) |
36 | #define XPC_VERSION_MINOR(_v) ((_v) & 0xf) | 36 | #define XPC_VERSION_MINOR(_v) ((_v) & 0xf) |
37 | 37 | ||
38 | /* | 38 | /* define frequency of the heartbeat and frequency how often it's checked */ |
39 | * The next macros define word or bit representations for given | ||
40 | * C-brick nasid in either the SAL provided bit array representing | ||
41 | * nasids in the partition/machine or the array of amo structures used | ||
42 | * for inter-partition initiation communications. | ||
43 | * | ||
44 | * For SN2 machines, C-Bricks are alway even numbered NASIDs. As | ||
45 | * such, some space will be saved by insisting that nasid information | ||
46 | * passed from SAL always be packed for C-Bricks and the | ||
47 | * cross-partition interrupts use the same packing scheme. | ||
48 | */ | ||
49 | #define XPC_NASID_W_INDEX(_n) (((_n) / 64) / 2) | ||
50 | #define XPC_NASID_B_INDEX(_n) (((_n) / 2) & (64 - 1)) | ||
51 | #define XPC_NASID_IN_ARRAY(_n, _p) ((_p)[XPC_NASID_W_INDEX(_n)] & \ | ||
52 | (1UL << XPC_NASID_B_INDEX(_n))) | ||
53 | #define XPC_NASID_FROM_W_B(_w, _b) (((_w) * 64 + (_b)) * 2) | ||
54 | |||
55 | #define XPC_HB_DEFAULT_INTERVAL 5 /* incr HB every x secs */ | 39 | #define XPC_HB_DEFAULT_INTERVAL 5 /* incr HB every x secs */ |
56 | #define XPC_HB_CHECK_DEFAULT_INTERVAL 20 /* check HB every x secs */ | 40 | #define XPC_HB_CHECK_DEFAULT_INTERVAL 20 /* check HB every x secs */ |
57 | 41 | ||
@@ -86,11 +70,13 @@ | |||
86 | * the actual nasids in the entire machine (mach_nasids). We're only | 70 | * the actual nasids in the entire machine (mach_nasids). We're only |
87 | * interested in the even numbered nasids (which contain the processors | 71 | * interested in the even numbered nasids (which contain the processors |
88 | * and/or memory), so we only need half as many bits to represent the | 72 | * and/or memory), so we only need half as many bits to represent the |
89 | * nasids. The part_nasids mask is located starting at the first cacheline | 73 | * nasids. When mapping nasid to bit in a mask (or bit to nasid) be sure |
90 | * following the reserved page header. The mach_nasids mask follows right | 74 | * to either divide or multiply by 2. The part_nasids mask is located |
91 | * after the part_nasids mask. The size in bytes of each mask is reflected | 75 | * starting at the first cacheline following the reserved page header. The |
92 | * by the reserved page header field 'SAL_nasids_size'. (Local partition's | 76 | * mach_nasids mask follows right after the part_nasids mask. The size in |
93 | * mask pointers are xpc_part_nasids and xpc_mach_nasids.) | 77 | * bytes of each mask is reflected by the reserved page header field |
78 | * 'SAL_nasids_size'. (Local partition's mask pointers are xpc_part_nasids | ||
79 | * and xpc_mach_nasids.) | ||
94 | * | 80 | * |
95 | * vars (ia64-sn2 only) | 81 | * vars (ia64-sn2 only) |
96 | * vars part (ia64-sn2 only) | 82 | * vars part (ia64-sn2 only) |
@@ -194,10 +180,11 @@ struct xpc_vars_part_sn2 { | |||
194 | #define XPC_RP_VARS_SIZE L1_CACHE_ALIGN(sizeof(struct xpc_vars_sn2)) | 180 | #define XPC_RP_VARS_SIZE L1_CACHE_ALIGN(sizeof(struct xpc_vars_sn2)) |
195 | 181 | ||
196 | #define XPC_RP_PART_NASIDS(_rp) ((u64 *)((u8 *)(_rp) + XPC_RP_HEADER_SIZE)) | 182 | #define XPC_RP_PART_NASIDS(_rp) ((u64 *)((u8 *)(_rp) + XPC_RP_HEADER_SIZE)) |
197 | #define XPC_RP_MACH_NASIDS(_rp) (XPC_RP_PART_NASIDS(_rp) + xpc_nasid_mask_words) | 183 | #define XPC_RP_MACH_NASIDS(_rp) (XPC_RP_PART_NASIDS(_rp) + \ |
184 | xpc_nasid_mask_nlongs) | ||
198 | #define XPC_RP_VARS(_rp) ((struct xpc_vars_sn2 *) \ | 185 | #define XPC_RP_VARS(_rp) ((struct xpc_vars_sn2 *) \ |
199 | (XPC_RP_MACH_NASIDS(_rp) + \ | 186 | (XPC_RP_MACH_NASIDS(_rp) + \ |
200 | xpc_nasid_mask_words)) | 187 | xpc_nasid_mask_nlongs)) |
201 | 188 | ||
202 | /* | 189 | /* |
203 | * Functions registered by add_timer() or called by kernel_thread() only | 190 | * Functions registered by add_timer() or called by kernel_thread() only |
@@ -695,9 +682,9 @@ extern void xpc_exit_uv(void); | |||
695 | 682 | ||
696 | /* found in xpc_partition.c */ | 683 | /* found in xpc_partition.c */ |
697 | extern int xpc_exiting; | 684 | extern int xpc_exiting; |
698 | extern int xpc_nasid_mask_words; | 685 | extern int xpc_nasid_mask_nlongs; |
699 | extern struct xpc_rsvd_page *xpc_rsvd_page; | 686 | extern struct xpc_rsvd_page *xpc_rsvd_page; |
700 | extern u64 *xpc_mach_nasids; | 687 | extern unsigned long *xpc_mach_nasids; |
701 | extern struct xpc_partition *xpc_partitions; | 688 | extern struct xpc_partition *xpc_partitions; |
702 | extern void *xpc_kmalloc_cacheline_aligned(size_t, gfp_t, void **); | 689 | extern void *xpc_kmalloc_cacheline_aligned(size_t, gfp_t, void **); |
703 | extern struct xpc_rsvd_page *xpc_setup_rsvd_page(void); | 690 | extern struct xpc_rsvd_page *xpc_setup_rsvd_page(void); |
@@ -706,8 +693,8 @@ extern int xpc_partition_disengaged(struct xpc_partition *); | |||
706 | extern enum xp_retval xpc_mark_partition_active(struct xpc_partition *); | 693 | extern enum xp_retval xpc_mark_partition_active(struct xpc_partition *); |
707 | extern void xpc_mark_partition_inactive(struct xpc_partition *); | 694 | extern void xpc_mark_partition_inactive(struct xpc_partition *); |
708 | extern void xpc_discovery(void); | 695 | extern void xpc_discovery(void); |
709 | extern enum xp_retval xpc_get_remote_rp(int, u64 *, struct xpc_rsvd_page *, | 696 | extern enum xp_retval xpc_get_remote_rp(int, unsigned long *, |
710 | u64 *); | 697 | struct xpc_rsvd_page *, u64 *); |
711 | extern void xpc_deactivate_partition(const int, struct xpc_partition *, | 698 | extern void xpc_deactivate_partition(const int, struct xpc_partition *, |
712 | enum xp_retval); | 699 | enum xp_retval); |
713 | extern enum xp_retval xpc_initiate_partid_to_nasids(short, void *); | 700 | extern enum xp_retval xpc_initiate_partid_to_nasids(short, void *); |