Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 7867
b: refs/heads/master
c: 61c8c15
h: refs/heads/master
i:
  7865: 774235b
  7863: 963d4af
v: v3
  • Loading branch information
Nicolas Pitre authored and Russell King committed Sep 8, 2005
1 parent 6f4a5a4 commit 7a506a8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 32 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0dffefbf1a26ee0661d47516420d86b485a08e9c
refs/heads/master: 61c8c158c828073cfebf11ca8e340727feafa038
18 changes: 3 additions & 15 deletions trunk/include/asm-arm/arch-pxa/hardware.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,24 +44,12 @@

#ifndef __ASSEMBLY__

#if 0
# define __REG(x) (*((volatile u32 *)io_p2v(x)))
#else
/*
* This __REG() version gives the same results as the one above, except
* that we are fooling gcc somehow so it generates far better and smaller
* assembly code for access to contigous registers. It's a shame that gcc
* doesn't guess this by itself.
*/
#include <asm/types.h>
typedef struct { volatile u32 offset[4096]; } __regbase;
# define __REGP(x) ((__regbase *)((x)&~4095))->offset[((x)&4095)>>2]
# define __REG(x) __REGP(io_p2v(x))
#endif
# define __REG(x) (*((volatile unsigned long *)io_p2v(x)))

/* With indexed regs we don't want to feed the index through io_p2v()
especially if it is a variable, otherwise horrible code will result. */
# define __REG2(x,y) (*(volatile u32 *)((u32)&__REG(x) + (y)))
# define __REG2(x,y) \
(*(volatile unsigned long *)((unsigned long)&__REG(x) + (y)))

# define __PREG(x) (io_v2p((u32)&(x)))

Expand Down
18 changes: 2 additions & 16 deletions trunk/include/asm-arm/arch-sa1100/hardware.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,23 +49,9 @@
( (((x)&0x00ffffff) | (((x)&(0x30000000>>VIO_SHIFT))<<VIO_SHIFT)) + PIO_START )

#ifndef __ASSEMBLY__
#include <asm/types.h>

#if 0
# define __REG(x) (*((volatile u32 *)io_p2v(x)))
#else
/*
* This __REG() version gives the same results as the one above, except
* that we are fooling gcc somehow so it generates far better and smaller
* assembly code for access to contigous registers. It's a shame that gcc
* doesn't guess this by itself.
*/
typedef struct { volatile u32 offset[4096]; } __regbase;
# define __REGP(x) ((__regbase *)((x)&~4095))->offset[((x)&4095)>>2]
# define __REG(x) __REGP(io_p2v(x))
#endif

# define __PREG(x) (io_v2p((u32)&(x)))
# define __REG(x) (*((volatile unsigned long *)io_p2v(x)))
# define __PREG(x) (io_v2p((unsigned long)&(x)))

#else

Expand Down

0 comments on commit 7a506a8

Please sign in to comment.