summaryrefslogtreecommitdiffstats
path: root/utils/hwstub/stub/asm/mips/atomic_rw.S
blob: 47c4213a5d178fbc41e8300960fde61724b79a29 (plain)
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
51
52
53
54
55
56
57
58
59
60
61
/***************************************************************************
 *             __________               __   ___.
 *   Open      \______   \ ____   ____ |  | _\_ |__   _______  ___
 *   Source     |       _//  _ \_/ ___\|  |/ /| __ \ /  _ \  \/  /
 *   Jukebox    |    |   (  <_> )  \___|    < | \_\ (  <_> > <  <
 *   Firmware   |____|_  /\____/ \___  >__|_ \|___  /\____/__/\_ \
 *                     \/            \/     \/    \/            \/
 *
 * Copyright (C) 2014 by Marcin Bukat
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
 * KIND, either express or implied.
 *
 ****************************************************************************/
#include "mips.h"

    .set noreorder
    .section   .text, "ax", %progbits
    .global    target_read8
    .type      target_read8, %function
    .global    target_read16
    .type      target_read16, %function
    .global    target_read32
    .type      target_read32, %function
    .global    target_write8
    .type      target_write8, %function
    .global    target_write16
    .type      target_write16, %function
    .global    target_write32
    .type      target_write32, %function

target_read8:
    jr ra
    lbu v0, 0(a0)

target_read16:
    jr ra
    lhu v0, 0(a0)

target_read32:
    jr ra
    lw v0, 0(a0)

target_write8:
    jr ra
    sb a1, 0(a0)

target_write16:
    jr ra
    sh a1, 0(a0)

target_write32:
    jr ra
    sw a1, 0(a0)

    .set reorder