4.115
Last change
on this file since c499856 was
c499856,
checked in by Chris Johns <chrisj@…>, on 03/20/14 at 21:10:47
|
Change all references of rtems.com to rtems.org.
|
-
Property mode set to
100644
|
File size:
819 bytes
|
Line | |
---|
1 | /** |
---|
2 | * @file |
---|
3 | * |
---|
4 | * @ingroup QorIQInterCom |
---|
5 | * |
---|
6 | * @brief qoriq_spin_lock() and qoriq_spin_unlock() implementation. |
---|
7 | */ |
---|
8 | |
---|
9 | /* |
---|
10 | * Copyright (c) 2011 embedded brains GmbH. All rights reserved. |
---|
11 | * |
---|
12 | * embedded brains GmbH |
---|
13 | * Obere Lagerstr. 30 |
---|
14 | * 82178 Puchheim |
---|
15 | * Germany |
---|
16 | * <rtems@embedded-brains.de> |
---|
17 | * |
---|
18 | * The license and distribution terms for this file may be |
---|
19 | * found in the file LICENSE in this distribution or at |
---|
20 | * http://www.rtems.org/license/LICENSE. |
---|
21 | */ |
---|
22 | |
---|
23 | #include <libcpu/powerpc-utility.h> |
---|
24 | |
---|
25 | .global qoriq_spin_lock |
---|
26 | .global qoriq_spin_unlock |
---|
27 | |
---|
28 | qoriq_spin_lock: |
---|
29 | li r0, 1 |
---|
30 | mfmsr r4 |
---|
31 | GET_INTERRUPT_MASK r5 |
---|
32 | andc r5, r4, r5 |
---|
33 | b 2f |
---|
34 | 1: |
---|
35 | mtmsr r4 |
---|
36 | 2: |
---|
37 | lwarx r6, r0, r3 |
---|
38 | cmpwi r6, 0 |
---|
39 | bne 2b |
---|
40 | mtmsr r5 |
---|
41 | stwcx. r0, r0, r3 |
---|
42 | bne 1b |
---|
43 | isync |
---|
44 | mr r3, r4 |
---|
45 | blr |
---|
46 | |
---|
47 | qoriq_spin_unlock: |
---|
48 | msync |
---|
49 | li r0, 0 |
---|
50 | stw r0, 0(r3) |
---|
51 | mtmsr r4 |
---|
52 | blr |
---|
Note: See
TracBrowser
for help on using the repository browser.