Commit 34a814b2 authored by Andrew Morton's avatar Andrew Morton Committed by Linus Torvalds

[PATCH] sn: Clean up the bit twiddle macros in pcibr_config.c

From: Pat Gefre <pfg@sgi.com>

Clean up the bit twiddle macros in pcibr_config.c
parent bd4339c3
...@@ -22,23 +22,12 @@ void pcibr_config_set(vertex_hdl_t, unsigned, unsigned, uint64_t); ...@@ -22,23 +22,12 @@ void pcibr_config_set(vertex_hdl_t, unsigned, unsigned, uint64_t);
void do_pcibr_config_set(cfg_p, unsigned, unsigned, uint64_t); void do_pcibr_config_set(cfg_p, unsigned, unsigned, uint64_t);
/* /*
* on sn-ia we need to twiddle the the addresses going out * fancy snia bit twiddling....
* the pci bus because we use the unswizzled synergy space
* (the alternative is to use the swizzled synergy space
* and byte swap the data)
*/ */
#define CB(b,r) (((volatile uint8_t *) b)[((r)^4)])
#define CS(b,r) (((volatile uint16_t *) b)[((r^4)/2)])
#define CW(b,r) (((volatile uint32_t *) b)[((r^4)/4)])
#define CBP(b,r) (((volatile uint8_t *) b)[(r)]) #define CBP(b,r) (((volatile uint8_t *) b)[(r)])
#define CSP(b,r) (((volatile uint16_t *) b)[((r)/2)]) #define CSP(b,r) (((volatile uint16_t *) b)[((r)/2)])
#define CWP(b,r) (((volatile uint32_t *) b)[(r)/4]) #define CWP(b,r) (((volatile uint32_t *) b)[(r)/4])
#define SCB(b,r) (((volatile uint8_t *) b)[((r)^3)])
#define SCS(b,r) (((volatile uint16_t *) b)[((r^2)/2)])
#define SCW(b,r) (((volatile uint32_t *) b)[((r)/4)])
/* /*
* Return a config space address for given slot / func / offset. Note the * Return a config space address for given slot / func / offset. Note the
* returned pointer is a 32bit word (ie. cfg_p) aligned pointer pointing to * returned pointer is a 32bit word (ie. cfg_p) aligned pointer pointing to
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment