Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 21101
b: refs/heads/master
c: 966f440
h: refs/heads/master
i:
  21099: 59b2a90
v: v3
  • Loading branch information
Ralf Baechle committed Mar 18, 2006
1 parent b02fd32 commit 589d79f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 4 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: 66a9a4ffda3474b193f36ed579cee06c597952f3
refs/heads/master: 966f4406d903a4214fdc74bec54710c6232a95b8
18 changes: 15 additions & 3 deletions trunk/include/asm-mips/io.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* for more details.
*
* Copyright (C) 1994, 1995 Waldorf GmbH
* Copyright (C) 1994 - 2000 Ralf Baechle
* Copyright (C) 1994 - 2000, 06 Ralf Baechle
* Copyright (C) 1999, 2000 Silicon Graphics, Inc.
* Copyright (C) 2004, 2005 MIPS Technologies, Inc. All rights reserved.
* Author: Maciej W. Rozycki <macro@mips.com>
Expand Down Expand Up @@ -103,8 +103,20 @@
*/
extern const unsigned long mips_io_port_base;

#define set_io_port_base(base) \
do { * (unsigned long *) &mips_io_port_base = (base); } while (0)
/*
* Gcc will generate code to load the value of mips_io_port_base after each
* function call which may be fairly wasteful in some cases. So we don't
* play quite by the book. We tell gcc mips_io_port_base is a long variable
* which solves the code generation issue. Now we need to violate the
* aliasing rules a little to make initialization possible and finally we
* will need the barrier() to fight side effects of the aliasing chat.
* This trickery will eventually collapse under gcc's optimizer. Oh well.
*/
static inline void set_io_port_base(unsigned long base)
{
* (unsigned long *) &mips_io_port_base = base;
barrier();
}

/*
* Thanks to James van Artsdalen for a better timing-fix than
Expand Down

0 comments on commit 589d79f

Please sign in to comment.