PS2SDK
PS2 Homebrew Libraries
Loading...
Searching...
No Matches
smem.c
Go to the documentation of this file.
1/*
2# _____ ___ ____ ___ ____
3# ____| | ____| | | |____|
4# | ___| |____ ___| ____| | \ PS2DEV Open Source Project.
5#-----------------------------------------------------------------------
6# Copyright (c) 2003 Marcus R. Brown <mrbrown@0xd6.org>
7# Licenced under Academic Free License version 2.0
8# Review ps2sdk README & LICENSE files for further details.
9*/
10
16#include <kernel.h>
17#include <string.h>
18
19#include "smem.h"
20
21u32 smem_read(void *addr, void *buf, u32 size)
22{
23 DI();
24 ee_kmode_enter();
25
26 memcpy(buf, (void *)((u8 *)addr + SUB_VIRT_MEM), size);
27
28 ee_kmode_exit();
29 EI();
30
31 return size;
32}
33
34u32 smem_write(void *addr, void *buf, u32 size)
35{
36 DI();
37 ee_kmode_enter();
38
39 memcpy((void *)((u8 *)addr + SUB_VIRT_MEM), buf, size);
40
41 ee_kmode_exit();
42 EI();
43
44 return size;
45}
#define SUB_VIRT_MEM
Definition smem.h:36