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
//! Direct Memory Access (DMA) operations.
#[cfg(any(target_os = "psp", doc))]
use core::ffi::c_void;
use pspsdk_macros::psp_stub;
use crate::sys::{SceResult, SceSize};
#[psp_stub(libname = "sceDmac", flags = 0x4009, version = (0x00, 0x11), use_crate)]
unsafe extern "C" {
/// Perform a DMA memory copy (blocking).
///
/// Copies `size` bytes from `src` to `dst` using the DMA controller.
///
/// This call blocks until the transfer is complete.
///
/// # Parameters
///
/// - `dst` **[[Out parameter]]**: A pointer to the destination memory.
/// - `src` **[[In parameter]]**: A pointer to the source memory.
/// - `size`: The number of bytes to copy.
///
/// # Return Value
///
/// `Ok` value on success, error value otherwise.
#[nid(0x617F3FE6)]
pub unsafe fn sceDmacMemcpy(
dst: *mut c_void, src: *const c_void, size: SceSize,
) -> SceResult<()>;
/// Perform a DMA memory copy (non-blocking attempt).
///
/// Like `sceDmacMemcpy`, but returns immediately with an error if
/// the DMA controller is busy.
///
/// # Parameters
///
/// - `dst` **[[Out parameter]]**: A pointer to the destination memory.
/// - `src` **[[In parameter]]**: A pointer to the source memory.
/// - `size`: The number of bytes to copy.
///
/// # Return Value
///
/// `Ok` value on success, error value otherwise (including busy).
#[nid(0xD97F94D8)]
pub unsafe fn sceDmacTryMemcpy(
dst: *mut c_void, src: *const c_void, size: SceSize,
) -> SceResult<()>;
}
// FIXME: Add `sceDmacplus_driver` functions (not required for PSPSDK parity)