Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 96340
b: refs/heads/master
c: 9c3cdc1
h: refs/heads/master
v: v3
  • Loading branch information
Linus Torvalds committed May 11, 2008
1 parent ac7ac09 commit c644dcf
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 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: 3ed43c745d2ce0c4ca15ad406285d1cc7e8ceec3
refs/heads/master: 9c3cdc1f83a6e07092392ff4aba6466517dbd1d0
12 changes: 12 additions & 0 deletions trunk/include/linux/compiler.h
Original file line number Diff line number Diff line change
Expand Up @@ -182,4 +182,16 @@ extern void __chk_io_ptr(const volatile void __iomem *);
# define __section(S) __attribute__ ((__section__(#S)))
#endif

/*
* Prevent the compiler from merging or refetching accesses. The compiler
* is also forbidden from reordering successive instances of ACCESS_ONCE(),
* but only when the compiler is aware of some particular ordering. One way
* to make the compiler aware of ordering is to put the two invocations of
* ACCESS_ONCE() in different C statements.
*
* This macro does absolutely -nothing- to prevent the CPU from reordering,
* merging, or refetching absolutely anything at any time.
*/
#define ACCESS_ONCE(x) (*(volatile typeof(x) *)&(x))

#endif /* __LINUX_COMPILER_H */
12 changes: 0 additions & 12 deletions trunk/include/linux/rcupdate.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,18 +131,6 @@ struct rcu_head {
*/
#define rcu_read_unlock_bh() __rcu_read_unlock_bh()

/*
* Prevent the compiler from merging or refetching accesses. The compiler
* is also forbidden from reordering successive instances of ACCESS_ONCE(),
* but only when the compiler is aware of some particular ordering. One way
* to make the compiler aware of ordering is to put the two invocations of
* ACCESS_ONCE() in different C statements.
*
* This macro does absolutely -nothing- to prevent the CPU from reordering,
* merging, or refetching absolutely anything at any time.
*/
#define ACCESS_ONCE(x) (*(volatile typeof(x) *)&(x))

/**
* rcu_dereference - fetch an RCU-protected pointer in an
* RCU read-side critical section. This pointer may later
Expand Down

0 comments on commit c644dcf

Please sign in to comment.