summaryrefslogtreecommitdiff
path: root/src/libultra/io/sprawwrite.c
blob: 1b121dfcb2be1a89faa17d9172afa8ba2d5d33e2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include "PR/os_internal.h"
#include "PR/rcp.h"
#include "PR/assert.h"
#include "osint.h"

// Adjust line numbers to match assert
#if BUILD_VERSION < VERSION_J
#line 45
#endif

// TODO: this comes from a header
#ident "$Revision: 1.17 $"

s32 __osSpRawWriteIo(u32 devAddr, u32 data) {
    assert((devAddr & 0x3) == 0);

    if (__osSpDeviceBusy()) {
        return -1;
    }

    IO_WRITE(devAddr, data);
    return 0;
}