source: rtems/bsps/powerpc/qoriq/mpci/lock.S @ 8f8ccee

5
Last change on this file since 8f8ccee was 1efa1c8, checked in by Sebastian Huber <sebastian.huber@…>, on 04/20/18 at 11:38:33

bsps: Move MPCI support to bsps

This patch is a part of the BSP source reorganization.

Update #3285.

  • 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
28qoriq_spin_lock:
29        li      r0, 1
30        mfmsr   r4
31        GET_INTERRUPT_MASK r5
32        andc    r5, r4, r5
33        b       2f
341:
35        mtmsr   r4
362:
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
47qoriq_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.