File: rtl_sync.h

package info (click to toggle)
rtlinux 3.1pre3-2
  • links: PTS
  • area: non-free
  • in suites: sarge, woody
  • size: 4,892 kB
  • ctags: 4,228
  • sloc: ansic: 26,204; sh: 2,069; makefile: 1,414; perl: 855; tcl: 489; asm: 380; cpp: 42
file content (50 lines) | stat: -rw-r--r-- 1,537 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/*
 * Copyright (C) 1999 FSM Labs (http://www.fsmlabs.com/)
 *  Written by Cort Dougan <cort@fsmlabs.com> and
 *  Victor Yodaiken <yodaiken@fsmlabs.com>
 *
 */
#ifndef __RTL_SYNC__
#define __RTL_SYNC__

#include <rtl_conf.h>
#include <arch/rtl_sync.h>

#include <asm/bitops.h>
#include <linux/spinlock.h>
#include <linux/config.h>

#define	rtl_hard_savef_and_cli(s) __rtl_hard_savef_and_cli(s)
#define	rtl_hard_restore_flags(s) __rtl_hard_restore_flags(s)
#define	rtl_hard_cli() __rtl_hard_cli()
#define	rtl_hard_sti() __rtl_hard_sti()
#define rtl_hard_save_flags(s) __rtl_hard_save_flags(s)

#define	rtl_no_interrupts(s) rtl_hard_savef_and_cli(s)
#define	rtl_restore_interrupts(s) rtl_hard_restore_flags(s)
#define	rtl_stop_interrupts() rtl_hard_cli()
#define	rtl_allow_interrupts() rtl_hard_sti()

#define rtl_spinlock_t spinlock_t
#define rtl_spin_lock_init(x) spin_lock_init(x)
#define rtl_spin_lock(x) spin_lock(x)
#define rtl_spin_trylock(x) spin_trylock(x)
#define rtl_spin_unlock(x) spin_unlock(x)

#define rtl_spin_lock_irqsave(x, flags) \
	do { rtl_no_interrupts(flags); rtl_spin_lock(x); } while (0)
#define rtl_spin_unlock_irqrestore(x, flags) \
	do { rtl_spin_unlock(x); rtl_restore_interrupts(flags); } while (0)

#ifdef CONFIG_SMP
#define rtl_critical(f) {rtl_spin_lock_irqsave(&RTL_SPIN_LOCK, f);}
#define rtl_end_critical(f) {rtl_spin_unlock_irqrestore(&RTL_SPIN_LOCK, f);}
#else
#define rtl_critical(f) rtl_no_interrupts(f)
#define rtl_end_critical(f) rtl_restore_interrupts(f)
#endif

#include <rtl_tracer.h>

#endif