Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 88976
b: refs/heads/master
c: 933a441
h: refs/heads/master
v: v3
  • Loading branch information
Joe Perches authored and Ingo Molnar committed Apr 17, 2008
1 parent f822a50 commit 980e2ac
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 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: 69cde6512c3a0227878869f9ba8a02cdc72fc253
refs/heads/master: 933a44155caeb4ff5b58fcf755e3381ae37e72d4
16 changes: 10 additions & 6 deletions trunk/include/asm-x86/mc146818rtc.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ extern volatile unsigned long cmos_lock;
static inline void lock_cmos(unsigned char reg)
{
unsigned long new;
new = ((smp_processor_id()+1) << 8) | reg;
new = ((smp_processor_id() + 1) << 8) | reg;
for (;;) {
if (cmos_lock) {
cpu_relax();
Expand All @@ -57,22 +57,26 @@ static inline void unlock_cmos(void)
{
cmos_lock = 0;
}

static inline int do_i_have_lock_cmos(void)
{
return (cmos_lock >> 8) == (smp_processor_id()+1);
return (cmos_lock >> 8) == (smp_processor_id() + 1);
}

static inline unsigned char current_lock_cmos_reg(void)
{
return cmos_lock & 0xff;
}
#define lock_cmos_prefix(reg) \

#define lock_cmos_prefix(reg) \
do { \
unsigned long cmos_flags; \
local_irq_save(cmos_flags); \
lock_cmos(reg)
#define lock_cmos_suffix(reg) \
unlock_cmos(); \
local_irq_restore(cmos_flags); \

#define lock_cmos_suffix(reg) \
unlock_cmos(); \
local_irq_restore(cmos_flags); \
} while (0)
#else
#define lock_cmos_prefix(reg) do {} while (0)
Expand Down

0 comments on commit 980e2ac

Please sign in to comment.