Skip to content

Commit

Permalink
Merge pull request #551 from uyjulian/heaplib_module
Browse files Browse the repository at this point in the history
Implementation of heaplib module
  • Loading branch information
fjtrujy authored Mar 23, 2024
2 parents 913a7bf + 6ade30c commit 0d472b2
Show file tree
Hide file tree
Showing 7 changed files with 492 additions and 0 deletions.
1 change: 1 addition & 0 deletions iop/system/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ SUBDIRS = \
eesync \
eesync-nano \
excepman \
heaplib \
intrman \
intrmanp \
ioman \
Expand Down
16 changes: 16 additions & 0 deletions iop/system/heaplib/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# _____ ___ ____ ___ ____
# ____| | ____| | | |____|
# | ___| |____ ___| ____| | \ PS2DEV Open Source Project.
#-----------------------------------------------------------------------
# Copyright ps2dev - http://www.ps2dev.org
# Licenced under Academic Free License version 2.0
# Review ps2sdk README & LICENSE files for further details.

IOP_BIN ?= heaplib.irx

IOP_OBJS = heaplib.o exports.o imports.o

include $(PS2SDKSRC)/Defs.make
include $(PS2SDKSRC)/iop/Rules.bin.make
include $(PS2SDKSRC)/iop/Rules.make
include $(PS2SDKSRC)/iop/Rules.release
17 changes: 17 additions & 0 deletions iop/system/heaplib/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Heap library

This module provides functions related to heap management.

## Configurations

There are multiple configurations of this library, allowing the choice of
balancing between size, speed, and features.

* `heaplib` -> The recommended version.

## How to use this module in your program

In order to use this module in your program, you must integrate the module into
an IOPRP image, then load the image with `UDNL`.\
Using `LoadModule` or `LoadModuleBuffer` directly will not work, because the
module is already loaded at IOP boot.
23 changes: 23 additions & 0 deletions iop/system/heaplib/src/exports.tab
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@

DECLARE_EXPORT_TABLE(heaplib, 1, 1)
DECLARE_EXPORT(_start)
DECLARE_EXPORT(_retonly)
DECLARE_EXPORT(_retonly)
DECLARE_EXPORT(_retonly)
DECLARE_EXPORT(CreateHeap)
DECLARE_EXPORT(DeleteHeap)
DECLARE_EXPORT(AllocHeapMemory)
DECLARE_EXPORT(FreeHeapMemory)
DECLARE_EXPORT(HeapTotalFreeSize)
DECLARE_EXPORT(_retonly)
DECLARE_EXPORT(_retonly)
DECLARE_EXPORT(HeapPrepare)
DECLARE_EXPORT(heaplib_12_chunk_is_valid)
DECLARE_EXPORT(heaplib_13_chunk_do_allocate)
DECLARE_EXPORT(heaplib_14_chunk_do_iterate)
DECLARE_EXPORT(HeapChunkSize)
DECLARE_EXPORT(_retonly)
DECLARE_EXPORT(_retonly)
END_EXPORT_TABLE

void _retonly() {}
Loading

0 comments on commit 0d472b2

Please sign in to comment.