22#define IH_C_BOUND 0x0001
24extern int _iop_reboot_count;
28#ifdef F_SifInitIopHeap
36 static int _rb_count = 0;
37 if (_rb_count != _iop_reboot_count) {
38 _rb_count = _iop_reboot_count;
39 memset(&_ih_cd, 0,
sizeof _ih_cd);
41 memset(&_ih_caps, 0,
sizeof _ih_caps);
49 while ((res = SifBindRpc(&_ih_cd, 0x80000003, 0)) >= 0 && !_ih_cd.server)
55 _ih_caps |= IH_C_BOUND;
61#ifdef F_SifExitIopHeap
68#ifdef F_SifAllocIopHeap
69void *SifAllocIopHeap(
int size)
77 if (SifInitIopHeap() < 0)
82 if (SifCallRpc(&_ih_cd, 1, 0, &arg, 4, &arg, 4, NULL, NULL) < 0)
85 return (
void *)arg.addr;
89#ifdef F_SifFreeIopHeap
90int SifFreeIopHeap(
void *addr)
98 if (SifInitIopHeap() < 0)
103 if (SifCallRpc(&_ih_cd, 2, 0, &arg, 4, &arg, 4, NULL, NULL) < 0)
110#ifdef F_SifLoadIopHeap
111int SifLoadIopHeap(
const char *path,
void *addr)
115 if (SifInitIopHeap() < 0)
119 strncpy(arg.path, path, LIH_PATH_MAX - 1);
120 arg.path[LIH_PATH_MAX - 1] = 0;
122 if (SifCallRpc(&_ih_cd, 3, 0, &arg,
sizeof arg, &arg, 4, NULL, NULL) < 0)