diff options
author | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
---|---|---|
committer | Glenn Elliott <gelliott@cs.unc.edu> | 2012-03-04 19:47:13 -0500 |
commit | c71c03bda1e86c9d5198c5d83f712e695c4f2a1e (patch) | |
tree | ecb166cb3e2b7e2adb3b5e292245fefd23381ac8 /net/tipc/addr.h | |
parent | ea53c912f8a86a8567697115b6a0d8152beee5c8 (diff) | |
parent | 6a00f206debf8a5c8899055726ad127dbeeed098 (diff) |
Merge branch 'mpi-master' into wip-k-fmlpwip-k-fmlp
Conflicts:
litmus/sched_cedf.c
Diffstat (limited to 'net/tipc/addr.h')
-rw-r--r-- | net/tipc/addr.h | 31 |
1 files changed, 9 insertions, 22 deletions
diff --git a/net/tipc/addr.h b/net/tipc/addr.h index c1cc5724d8cc..e4f35afe3207 100644 --- a/net/tipc/addr.h +++ b/net/tipc/addr.h | |||
@@ -37,19 +37,17 @@ | |||
37 | #ifndef _TIPC_ADDR_H | 37 | #ifndef _TIPC_ADDR_H |
38 | #define _TIPC_ADDR_H | 38 | #define _TIPC_ADDR_H |
39 | 39 | ||
40 | static inline u32 own_node(void) | 40 | #define TIPC_ZONE_MASK 0xff000000u |
41 | { | 41 | #define TIPC_CLUSTER_MASK 0xfffff000u |
42 | return tipc_node(tipc_own_addr); | ||
43 | } | ||
44 | 42 | ||
45 | static inline u32 own_cluster(void) | 43 | static inline u32 tipc_zone_mask(u32 addr) |
46 | { | 44 | { |
47 | return tipc_cluster(tipc_own_addr); | 45 | return addr & TIPC_ZONE_MASK; |
48 | } | 46 | } |
49 | 47 | ||
50 | static inline u32 own_zone(void) | 48 | static inline u32 tipc_cluster_mask(u32 addr) |
51 | { | 49 | { |
52 | return tipc_zone(tipc_own_addr); | 50 | return addr & TIPC_CLUSTER_MASK; |
53 | } | 51 | } |
54 | 52 | ||
55 | static inline int in_own_cluster(u32 addr) | 53 | static inline int in_own_cluster(u32 addr) |
@@ -57,16 +55,6 @@ static inline int in_own_cluster(u32 addr) | |||
57 | return !((addr ^ tipc_own_addr) >> 12); | 55 | return !((addr ^ tipc_own_addr) >> 12); |
58 | } | 56 | } |
59 | 57 | ||
60 | static inline int is_slave(u32 addr) | ||
61 | { | ||
62 | return addr & 0x800; | ||
63 | } | ||
64 | |||
65 | static inline int may_route(u32 addr) | ||
66 | { | ||
67 | return(addr ^ tipc_own_addr) >> 11; | ||
68 | } | ||
69 | |||
70 | /** | 58 | /** |
71 | * addr_domain - convert 2-bit scope value to equivalent message lookup domain | 59 | * addr_domain - convert 2-bit scope value to equivalent message lookup domain |
72 | * | 60 | * |
@@ -74,14 +62,13 @@ static inline int may_route(u32 addr) | |||
74 | * after a network hop. | 62 | * after a network hop. |
75 | */ | 63 | */ |
76 | 64 | ||
77 | static inline int addr_domain(int sc) | 65 | static inline u32 addr_domain(u32 sc) |
78 | { | 66 | { |
79 | if (likely(sc == TIPC_NODE_SCOPE)) | 67 | if (likely(sc == TIPC_NODE_SCOPE)) |
80 | return tipc_own_addr; | 68 | return tipc_own_addr; |
81 | if (sc == TIPC_CLUSTER_SCOPE) | 69 | if (sc == TIPC_CLUSTER_SCOPE) |
82 | return tipc_addr(tipc_zone(tipc_own_addr), | 70 | return tipc_cluster_mask(tipc_own_addr); |
83 | tipc_cluster(tipc_own_addr), 0); | 71 | return tipc_zone_mask(tipc_own_addr); |
84 | return tipc_addr(tipc_zone(tipc_own_addr), 0, 0); | ||
85 | } | 72 | } |
86 | 73 | ||
87 | int tipc_addr_domain_valid(u32); | 74 | int tipc_addr_domain_valid(u32); |