2 * Helpers used by both rw spinlocks and rw semaphores.
4 * Based in part on code from semaphore.h and
5 * spinlock.h Copyright 1996 Linus Torvalds.
7 * Copyright 1999 Red Hat, Inc.
9 * Written by Benjamin LaHaise.
11 * Modified by Matsushita Electric Industrial Co., Ltd.
13 * 13-Nov-2006 MEI Temporarily delete lock functions for SMP support.
15 * This program is free software; you can redistribute it and/or modify it
16 * under the terms of the GNU General Public License as published by the Free
17 * Software Foundation; either version 2 of the License, or (at your option)
23 #define RW_LOCK_BIAS 0x01000000
27 typedef struct { unsigned long a
[100]; } __dummy_lock_t
;
28 #define __dummy_lock(lock) (*(__dummy_lock_t *)(lock))
30 #define RW_LOCK_BIAS_STR "0x01000000"
32 #define __build_read_lock_ptr(rw, helper) \
42 " .section .text.lock,\"ax\" \n" \
43 "3: call "helper"[],0 \n" \
48 : "memory", "d3", "cc"); \
51 #define __build_read_lock_const(rw, helper) \
61 " .section .text.lock,\"ax\" \n" \
62 "3: call "helper"[],0 \n" \
67 : "memory", "d3", "cc"); \
70 #define __build_read_lock(rw, helper) \
72 if (__builtin_constant_p(rw)) \
73 __build_read_lock_const(rw, helper); \
75 __build_read_lock_ptr(rw, helper); \
78 #define __build_write_lock_ptr(rw, helper) \
88 " .section .text.lock,\"ax\" \n" \
89 "3: call "helper"[],0 \n" \
94 : "memory", "d3", "cc"); \
97 #define __build_write_lock_const(rw, helper) \
107 " .section .text.lock,\"ax\" \n" \
108 "3: call "helper"[],0 \n" \
113 : "memory", "d3", "cc"); \
116 #define __build_write_lock(rw, helper) \
118 if (__builtin_constant_p(rw)) \
119 __build_write_lock_const(rw, helper); \
121 __build_write_lock_ptr(rw, helper); \
124 #endif /* CONFIG_SMP */
125 #endif /* _ASM_RWLOCK_H */