1/**
2 * \file
3 * \brief kernel driver for the spinlock module, used for serial output
4 * see OMAP4460 TRM chapter 21 for a functional description
5 */
6
7/*
8 * Copyright (c) 2013, ETH Zurich.
9 * All rights reserved.
10 *
11 * This file is distributed under the terms in the attached LICENSE file.
12 * If you do not find this file, copies can be found by writing to:
13 * ETH Zurich D-INFK, Universitaetstrasse 6, CH-8092 Zurich. Attn: Systems Group.
14 */
15
16#ifndef __OMAP44XX_SPINLOCK_H__
17#define __OMAP44XX_SPINLOCK_H__
18
19#include <kernel.h>
20
21#define OMAP44XX_SPINLOCK_NUM_LOCKS 32
22
23/**
24 * \brief Map the OMAP44xx spinlock device into kernel virtual memory
25 * and reset it.
26 */
27extern errval_t omap44xx_spinlock_init(void);
28
29/**
30 * \brief acquire an OMAP44xx spinlock.  We repeatedly read the
31 * register; 0 means we have the lock, 1 means we have to try again.
32 */
33extern void omap44xx_spinlock_acquire( unsigned locknumber );
34
35/**
36 * \brief release an OMAP44xx spinlock.
37 */
38extern void omap44xx_spinlock_release( unsigned locknumber );
39
40#endif  // __OMAP44XX_SPINLOCK_H__
41