From 0b3c5f604e7ac5ae364c31e3eeb326f4ad1fa0f3 Mon Sep 17 00:00:00 2001 From: Julian Uy Date: Fri, 6 Dec 2024 14:55:53 -0600 Subject: [PATCH] refactor: use extern for forward decls in headers --- common/include/libcdvd-common.h | 188 ++++----- common/include/libsd-common.h | 62 +-- common/include/netman.h | 40 +- common/include/ps2snd.h | 20 +- common/include/sys/random.h | 2 +- common/sbus/include/ps2_sbus.h | 32 +- ee/debug/include/debug.h | 32 +- ee/debug/include/hwbp.h | 36 +- ee/debug/include/screenshot.h | 4 +- ee/dma/include/dma.h | 26 +- ee/draw/include/draw.h | 12 +- ee/draw/include/draw2d.h | 30 +- ee/draw/include/draw3d.h | 12 +- ee/draw/include/draw_blending.h | 6 +- ee/draw/include/draw_buffers.h | 12 +- ee/draw/include/draw_dithering.h | 4 +- ee/draw/include/draw_fog.h | 2 +- ee/draw/include/draw_masking.h | 4 +- ee/draw/include/draw_primitives.h | 6 +- ee/draw/include/draw_sampling.h | 10 +- ee/draw/include/draw_tests.h | 8 +- ee/eedebug/include/ee_debug.h | 56 +-- ee/elf-loader/include/elf-loader.h | 4 +- ee/erl/include/erl.h | 26 +- ee/erl/include/hashtab.h | 16 +- ee/erl/include/lookupa.h | 4 +- ee/erl/include/recycle.h | 8 +- ee/font/include/font.h | 20 +- ee/graph/include/graph.h | 36 +- ee/graph/include/graph_config.h | 10 +- ee/graph/include/graph_vram.h | 8 +- ee/input/include/input.h | 30 +- ee/iopreboot/include/iopcontrol_special.h | 4 +- ee/kernel/include/fileio.h | 44 +- ee/kernel/include/iopcontrol.h | 8 +- ee/kernel/include/iopheap.h | 10 +- ee/kernel/include/kernel.h | 376 +++++++++--------- ee/kernel/include/loadfile.h | 36 +- ee/kernel/include/osd_config.h | 62 +-- ee/kernel/include/rom0_info.h | 12 +- ee/kernel/include/sifcmd.h | 20 +- ee/kernel/include/sifdma.h | 4 +- ee/kernel/include/sifrpc.h | 26 +- ee/kernel/include/sio.h | 20 +- ee/kernel/src/osdsrc/src/ExecPS2.h | 2 +- ee/kernel/src/osdsrc/src/osd.h | 10 +- ee/kernel/src/srcfile/src/internal.h | 6 +- ee/libcglue/include/arpa/inet.h | 8 +- ee/libcglue/include/netdb.h | 10 +- ee/libcglue/include/ps2sdkapi.h | 12 +- ee/libcglue/include/sjis.h | 4 +- ee/libcglue/include/sys/socket.h | 58 +-- ee/libcglue/samples/regress/testsuite.h | 6 +- ee/libcglue/src/fdman.h | 12 +- ee/libgs/include/libgs.h | 106 ++--- ee/libgs/src/internal.h | 10 +- ee/libprofglue/include/ps2prof.h | 2 + ee/libpthreadglue/src/include/ps2_osal.h | 18 +- ee/math3d/include/math3d.h | 58 +-- ee/mpeg/include/libmpeg.h | 4 +- ee/mpeg/src/libmpeg_internal.h | 88 ++-- ee/network/netman/src/include/internal.h | 4 +- ee/network/netman/src/include/rpc_client.h | 12 +- ee/network/netman/src/include/rpc_server.h | 6 +- ee/network/tcpip/include/ps2ip.h | 50 +-- ee/network/tcpip/src/include/arch/sys_arch.h | 2 +- ee/network/tcpip/src/ps2ip_internal.h | 2 +- ee/network/tcpip/src/ps2ipee.h | 64 +-- ee/packet/include/packet.h | 8 +- ee/packet2/include/packet2.h | 14 +- ee/packet2/include/packet2_vif.h | 2 +- ee/rpc/ahx/include/ahx_rpc.h | 20 +- ee/rpc/audsrv/include/audsrv.h | 60 +-- ee/rpc/camera/include/ps2cam_rpc.h | 26 +- ee/rpc/camera/samples/libjpg.h | 20 +- ee/rpc/cdvd/include/libcdvd.h | 6 +- ee/rpc/cdvd/src/internal.h | 6 +- ee/rpc/filexio/include/fileXio_rpc.h | 68 ++-- ee/rpc/hdd/include/libhdd.h | 16 +- ee/rpc/keyboard/include/libkbd.h | 28 +- ee/rpc/memorycard/include/libmc.h | 132 +++--- ee/rpc/mouse/include/libmouse.h | 34 +- ee/rpc/multitap/include/libmtap.h | 8 +- ee/rpc/pad/include/libpad.h | 50 +-- ee/rpc/poweroff/include/libpwroff.h | 8 +- ee/rpc/remote/include/librm.h | 12 +- ee/rpc/sior/include/sior_rpc.h | 2 +- ee/rpc/tcpips/include/ps2ips.h | 4 +- ee/sbv/include/sbv_patches.h | 8 +- ee/sbv/include/slib.h | 4 +- ee/sbv/include/smem.h | 4 +- ee/sbv/include/smod.h | 4 +- ee/sbv/src/common.h | 4 +- iop/cdvd/cdfs/src/cdfs_iop.h | 14 +- iop/debug/iop_sbusdbg/include/iop_sbusdbg.h | 50 +-- iop/debug/iop_sbusdbg/src/sbus_tty.h | 2 +- iop/debug/iopdebug/include/iopdebug.h | 42 +- iop/debug/ioptrap/include/ioptrap.h | 20 +- iop/debug/ppctty/src/tty.h | 2 +- iop/debug/sior/src/xprintf.h | 8 +- iop/dev9/atad/include/atad.h | 36 +- iop/dev9/dev9/include/dev9.h | 24 +- iop/dev9/poweroff/include/poweroff.h | 8 +- iop/fs/bdm/include/bdm.h | 12 +- iop/fs/bdm/src/include/part_driver.h | 6 +- iop/fs/devfs/include/devfs.h | 8 +- iop/fs/libbdm/include/bd_cache.h | 4 +- iop/fs/libbdm/include/bd_defrag.h | 4 +- iop/fs/netfs/src/devscan.h | 8 +- iop/fs/netfs/src/ps2_fio.h | 4 +- iop/fs/vfat/src/include/fat.h | 10 +- iop/fs/vfat/src/include/fat_driver.h | 36 +- iop/fs/vfat/src/include/fat_write.h | 18 +- iop/fs/vfat/src/include/part_driver.h | 8 +- iop/fs/vfat/src/include/scache.h | 22 +- iop/fs/vfat/src/include/usbhd_common.h | 4 +- iop/hdd/apa/src/hdd.h | 4 +- iop/hdd/apa/src/hdd_fio.h | 34 +- iop/hdd/hdsk/src/hdl.h | 2 +- iop/hdd/libapa/include/libapa.h | 82 ++-- iop/hdd/libpfs/include/libpfs.h | 194 ++++----- iop/hdd/pfs/src/pfs.h | 4 +- iop/hdd/pfs/src/pfs_fio.h | 60 +-- iop/hdd/pfs/src/pfs_fioctl.h | 8 +- iop/iLink/IEEE1394_bd/src/include/sbp2_disk.h | 8 +- iop/iLink/IEEE1394_bd/src/include/scsi.h | 6 +- .../IEEE1394_disk/src/include/sbp2_disk.h | 8 +- iop/iLink/IEEE1394_disk/src/include/scsi.h | 8 +- iop/iLink/iLinkman/include/iLinkman.h | 56 +-- .../iLinkman/src/include/iLink_internal.h | 62 +-- iop/kernel/include/cdvdfsv.h | 2 +- iop/kernel/include/cdvdman.h | 30 +- iop/kernel/include/dmacman.h | 64 +-- iop/kernel/include/excepman.h | 12 +- iop/kernel/include/heaplib.h | 16 +- iop/kernel/include/intrman.h | 38 +- iop/kernel/include/ioman.h | 34 +- iop/kernel/include/ioman_mod.h | 34 +- iop/kernel/include/loadcore.h | 42 +- iop/kernel/include/modload.h | 28 +- iop/kernel/include/setjmp.h | 4 +- iop/kernel/include/sifcmd.h | 64 +-- iop/kernel/include/sifman.h | 58 +-- iop/kernel/include/sior.h | 24 +- iop/kernel/include/ssbusc.h | 28 +- iop/kernel/include/stdio.h | 22 +- iop/kernel/include/sysclib.h | 76 ++-- iop/kernel/include/sysmem.h | 20 +- iop/kernel/include/thbase.h | 76 ++-- iop/kernel/include/thevent.h | 20 +- iop/kernel/include/thmsgbx.h | 16 +- iop/kernel/include/thpool.h | 32 +- iop/kernel/include/thsemap.h | 16 +- iop/kernel/include/timrman.h | 32 +- iop/kernel/include/vblank.h | 16 +- iop/kernel/include/xloadcore.h | 6 +- iop/kernel/include/xmodload.h | 26 +- iop/kernel/include/xmtapman.h | 8 +- iop/kernel/include/xpadman.h | 30 +- iop/kernel/include/xsio2man.h | 24 +- iop/kernel/include/xsysmem.h | 2 +- iop/kernel/include/xthbase.h | 12 +- iop/kernel/include/xtimrman.h | 10 +- iop/memorycard/mcman/include/mcman.h | 80 ++-- iop/memorycard/mcman/src/mcman-internal.h | 198 ++++----- iop/memorycard/mcserv/src/mcserv.h | 88 ++-- iop/network/netman/src/include/internal.h | 8 +- iop/network/netman/src/include/rpc_client.h | 12 +- iop/network/netman/src/include/rpc_server.h | 4 +- iop/network/smap/src/include/main.h | 24 +- iop/network/smap/src/include/xfer.h | 4 +- iop/network/smbman/src/auth.h | 6 +- iop/network/smbman/src/des.h | 2 +- iop/network/smbman/src/md4.h | 2 +- iop/network/smbman/src/poll.h | 2 +- iop/network/smbman/src/smb.h | 50 +-- iop/network/smbman/src/smb_fio.h | 38 +- iop/security/secrman/src/CardAuth.h | 28 +- iop/security/secrman/src/MechaAuth.h | 44 +- iop/security/secrman/src/keyman.h | 12 +- iop/sio/mx4sio_bd/src/crc16.h | 2 +- iop/sio/mx4sio_bd/src/ioplib.h | 8 +- iop/sio/mx4sio_bd/src/mx4sio.h | 26 +- iop/sio/mx4sio_bd/src/sio2man_hook.h | 8 +- iop/sio/mx4sio_bd/src/spi_sdcard_crc7.h | 4 +- iop/sio/mx4sio_bd/src/spi_sdcard_driver.h | 16 +- iop/sound/ahx/include/ahx.h | 30 +- iop/sound/audsrv/include/audsrv.h | 56 +-- iop/sound/audsrv/src/common.h | 4 +- iop/sound/audsrv/src/hw.h | 2 +- iop/sound/audsrv/src/rpc_client.h | 6 +- iop/sound/audsrv/src/rpc_server.h | 2 +- iop/sound/audsrv/src/upsamplers.h | 2 +- iop/system/alloc/include/alloc.h | 18 +- iop/system/iopmgr/include/iopmgr.h | 28 +- iop/system/mtapman/src/freemtap.h | 12 +- iop/system/padman/src/freepad.h | 38 +- iop/system/padman/src/padCmds.h | 26 +- iop/system/padman/src/padData.h | 36 +- iop/system/padman/src/rpcserver.h | 2 +- iop/system/padman/src/sio2Cmds.h | 52 +-- iop/system/rmman/include/rmman.h | 8 +- iop/system/rsio2man/include/rsio2man.h | 4 +- iop/system/sbusintr/include/sbusintr.h | 10 +- iop/system/siftoo/include/siftoo.h | 18 +- iop/system/sio2man/include/log.h | 20 +- iop/system/sio2man/include/sio2man.h | 44 +- iop/system/threadman/src/thcommon.h | 28 +- iop/tcpip/tcpip-base/include/arch/sys_arch.h | 6 +- iop/tcpip/tcpip/include/ps2ip.h | 108 ++--- iop/usb/camera/include/ps2cam.h | 84 ++-- iop/usb/usbd/include/usbd.h | 32 +- iop/usb/usbhdfsd/include/usbhdfsd.h | 14 +- iop/usb/usbhdfsd/src/include/mass_stor.h | 18 +- iop/usb/usbmass_bd/src/include/scsi.h | 6 +- skeleton/iop/hello.h | 2 +- tools/ps2adpcm/src/adpcm.h | 6 +- tools/romimg/src/SonyRX.h | 4 +- tools/romimg/src/platform.h | 12 +- tools/romimg/src/romimg.h | 16 +- 220 files changed, 2860 insertions(+), 2858 deletions(-) diff --git a/common/include/libcdvd-common.h b/common/include/libcdvd-common.h index 28d85361868..41f6d33a9e9 100644 --- a/common/include/libcdvd-common.h +++ b/common/include/libcdvd-common.h @@ -386,16 +386,16 @@ extern "C" { * @param mode mode to read as * @return 1 on success, 0 on failure. */ -int sceCdRead(u32 lbn, u32 sectors, void *buffer, sceCdRMode *mode); -int sceCdReadDVDV(u32 lbn, u32 sectors, void *buffer, sceCdRMode *mode); -int sceCdReadCDDA(u32 lbn, u32 sectors, void *buffer, sceCdRMode *mode); +extern int sceCdRead(u32 lbn, u32 sectors, void *buffer, sceCdRMode *mode); +extern int sceCdReadDVDV(u32 lbn, u32 sectors, void *buffer, sceCdRMode *mode); +extern int sceCdReadCDDA(u32 lbn, u32 sectors, void *buffer, sceCdRMode *mode); /** get toc from inserted disc * * @param toc buffer to hold toc (1024 bytes) * @return 1 on success, 0 on failure. */ -int sceCdGetToc(u8 *toc); +extern int sceCdGetToc(u8 *toc); /** Alternate TOC retrieving function with parameter * @@ -403,7 +403,7 @@ int sceCdGetToc(u8 *toc); * @param param Parameter * @return 1 on success, 0 on failure. */ -int sceCdGetToc2(u8 *toc, int param); +extern int sceCdGetToc2(u8 *toc, int param); /** seek to given sector on disc * non-blocking, requires sceCdSync() call @@ -411,28 +411,28 @@ int sceCdGetToc2(u8 *toc, int param); * @param lbn sector to seek to on disc * @return 1 on success, 0 on failure. */ -int sceCdSeek(u32 lbn); +extern int sceCdSeek(u32 lbn); /** puts ps2 sceCd drive into standby mode * non-blocking, requires sceCdSync() call * * @return 1 on success, 0 on failure. */ -int sceCdStandby(void); +extern int sceCdStandby(void); /** stops ps2 sceCd drive from spinning * non-blocking, requires sceCdSync() call * * @return 1 on success, 0 on failure. */ -int sceCdStop(void); +extern int sceCdStop(void); /** pauses ps2 sceCd drive * non-blocking, requires sceCdSync() call * * @return 1 on success, 0 on failure. */ -int sceCdPause(void); +extern int sceCdPause(void); /** do a 'chain' of reads with one command * last chain value must be all 0xFFFFFFFF @@ -445,7 +445,7 @@ int sceCdPause(void); * @param mode read mode * @return 1 on success, 0 on failure. */ -int sceCdReadChain(sceCdRChain *tag, sceCdRMode *mode); +extern int sceCdReadChain(sceCdRChain *tag, sceCdRMode *mode); /** send an n-command by function number * @@ -454,7 +454,7 @@ int sceCdReadChain(sceCdRChain *tag, sceCdRMode *mode); * @param inBuffSize size of input buffer (0 - 16 bytes) * @return 1 on success, 0 on failure. */ -int sceCdApplyNCmd(u8 cmdNum, const void* inBuff, u16 inBuffSize); +extern int sceCdApplyNCmd(u8 cmdNum, const void* inBuff, u16 inBuffSize); // **** S-Command functions **** @@ -466,7 +466,7 @@ int sceCdApplyNCmd(u8 cmdNum, const void* inBuff, u16 inBuffSize); * @param clock time/date struct * @return 1 on success, 0 on failure. */ -int sceCdReadClock(sceCdCLOCK *clock); +extern int sceCdReadClock(sceCdCLOCK *clock); /** Sets the PlayStation 2 clock. * (time value is in BCD) @@ -476,19 +476,19 @@ int sceCdReadClock(sceCdCLOCK *clock); * @param clock time/date struct to set clocks time with * @return 1 on success, 0 on failure. */ -int sceCdWriteClock(sceCdCLOCK *clock); +extern int sceCdWriteClock(sceCdCLOCK *clock); /** gets the type of the currently inserted disc * * @return disk type (SCECdvdMediaTypes) */ -int sceCdGetDiskType(void); +extern int sceCdGetDiskType(void); /** gets the last error that occurred * * @return error type (SCECdvdErrorCode) */ -int sceCdGetError(void); +extern int sceCdGetError(void); /** open/close/check disk tray * @@ -496,19 +496,19 @@ int sceCdGetError(void); * @param traychk address for returning tray state change * @return 1 on success, 0 on failure. */ -int sceCdTrayReq(int param, u32 *traychk); +extern int sceCdTrayReq(int param, u32 *traychk); /** gets the state of the drive * * @return status (SCECdvdDriveStates) */ -int sceCdStatus(void); +extern int sceCdStatus(void); /** 'breaks' the currently executing command * * @return 1 on success, 0 on failure. */ -int sceCdBreak(void); +extern int sceCdBreak(void); /** cancel power off * Minimum Mechacon firmware version: 20400 @@ -517,7 +517,7 @@ int sceCdBreak(void); * @param result result * @return 1 on success, 0 on failure. */ -int sceCdCancelPOffRdy(u32 *result); +extern int sceCdCancelPOffRdy(u32 *result); /** blue led control * @@ -527,7 +527,7 @@ int sceCdCancelPOffRdy(u32 *result); * @param result result * @return 1 on success, 0 on failure. */ -int sceCdBlueLEDCtl(u8 control, u32 *result); +extern int sceCdBlueLEDCtl(u8 control, u32 *result); /** power off * @@ -536,7 +536,7 @@ int sceCdBlueLEDCtl(u8 control, u32 *result); * @param result result * @return 1 on success, 0 on failure. */ -int sceCdPowerOff(u32 *result); +extern int sceCdPowerOff(u32 *result); /** set media mode * @@ -545,7 +545,7 @@ int sceCdPowerOff(u32 *result); * @param media media mode (SCECdvdMModeMediaTypes) * @return 1 on success, 0 on failure. */ -int sceCdMmode(int media); +extern int sceCdMmode(int media); /** change libcdvd thread priority * @@ -554,7 +554,7 @@ int sceCdMmode(int media); * @param priority priority * @return 1 on success, 0 on failure. */ -int sceCdChangeThreadPriority(int priority); +extern int sceCdChangeThreadPriority(int priority); /** send an s-command by function number * @@ -564,7 +564,7 @@ int sceCdChangeThreadPriority(int priority); * @param output buffer (16 bytes, can be null) * @return 1 if successful, 0 if error */ -int sceCdApplySCmd(u8 cmdNum, const void *inBuff, u16 inBuffSize, void *outBuff); +extern int sceCdApplySCmd(u8 cmdNum, const void *inBuff, u16 inBuffSize, void *outBuff); // **** Streaming Functions **** @@ -574,7 +574,7 @@ int sceCdApplySCmd(u8 cmdNum, const void *inBuff, u16 inBuffSize, void *outBuff) * @param mode mode to read in * @return 1 on success, 0 on failure. */ -int sceCdStStart(u32 lbn, sceCdRMode *mode); +extern int sceCdStStart(u32 lbn, sceCdRMode *mode); /** read stream data * @@ -584,20 +584,20 @@ int sceCdStStart(u32 lbn, sceCdRMode *mode); * @param error error value holder * @return number of sectors read if successful, 0 otherwise */ -int sceCdStRead(u32 sectors, u32 *buffer, u32 mode, u32 *error); +extern int sceCdStRead(u32 sectors, u32 *buffer, u32 mode, u32 *error); /** stop streaming * * @return 1 on success, 0 on failure. */ -int sceCdStStop(void); +extern int sceCdStStop(void); /** seek to a new stream position * * @param lbn sector location to start streaming from * @return 1 on success, 0 on failure. */ -int sceCdStSeek(u32 lbn); +extern int sceCdStSeek(u32 lbn); /** init streaming * @@ -606,25 +606,25 @@ int sceCdStSeek(u32 lbn); * @param buffer buffer address on iop * @return 1 on success, 0 on failure. */ -int sceCdStInit(u32 bufmax, u32 bankmax, void *buffer); +extern int sceCdStInit(u32 bufmax, u32 bankmax, void *buffer); /** get stream read status * * @return number of sectors read if successful, 0 otherwise */ -int sceCdStStat(void); +extern int sceCdStStat(void); /** pause streaming * * @return 1 on success, 0 on failure. */ -int sceCdStPause(void); +extern int sceCdStPause(void); /** continue streaming * * @return 1 on success, 0 on failure. */ -int sceCdStResume(void); +extern int sceCdStResume(void); // **** Other Functions **** @@ -633,14 +633,14 @@ int sceCdStResume(void); * @param mode mode (SCECdvdInitModes) * @return 1 on success, 0 on failure. */ -int sceCdInit(int mode); +extern int sceCdInit(int mode); /** waits/checks for completion of n-commands * * @param mode 0 = wait for completion of command (blocking), 1 = check current status and return immediately * @return 0 = completed, 1 = not completed */ -int sceCdSync(int mode); +extern int sceCdSync(int mode); /** search for a file on disc * @@ -648,23 +648,23 @@ int sceCdSync(int mode); * @param name name of file to search for (no wildcard characters) (should be in the form '\\SYSTEM.CNF;1') * @return 1 on success, 0 on failure. (or no file found) */ -int sceCdSearchFile(sceCdlFILE *file, const char *name); +extern int sceCdSearchFile(sceCdlFILE *file, const char *name); /** checks if drive is ready * * @param mode mode * @return SCECdComplete if ready, SCECdNotReady if busy */ -int sceCdDiskReady(int mode); +extern int sceCdDiskReady(int mode); /** convert from sector number to minute:second:frame */ -sceCdlLOCCD *sceCdIntToPos(u32 i, sceCdlLOCCD *p); +extern sceCdlLOCCD *sceCdIntToPos(u32 i, sceCdlLOCCD *p); /** convert from minute:second:frame to sector number */ -u32 sceCdPosToInt(sceCdlLOCCD *p); +extern u32 sceCdPosToInt(sceCdlLOCCD *p); /** get the current read position (when reading using sceCdRead) */ -u32 sceCdGetReadPos(void); +extern u32 sceCdGetReadPos(void); /** initialise EE callback thread * @@ -673,14 +673,14 @@ u32 sceCdGetReadPos(void); * @param stackSize callback thread stack size * @return 1 if initialised callback, 0 if only priority was changed */ -int sceCdInitEeCB(int priority, void *stackAddr, int stackSize); +extern int sceCdInitEeCB(int priority, void *stackAddr, int stackSize); /** set sceCd callback function * * @param function pointer to new callback function * @return pointer to old function */ -sceCdCBFunc sceCdCallback(sceCdCBFunc function); +extern sceCdCBFunc sceCdCallback(sceCdCBFunc function); /** Reads SUBQ data from the disc. // @@ -688,7 +688,7 @@ sceCdCBFunc sceCdCallback(sceCdCBFunc function); // @param status Result code. // @return 1 on success, 0 on failure. */ -int sceCdReadSUBQ(void *buffer, u32 *status); +extern int sceCdReadSUBQ(void *buffer, u32 *status); // **** System functions **** @@ -698,7 +698,7 @@ int sceCdReadSUBQ(void *buffer, u32 *status); * @param result Result code. * @return 1 on success, 0 on failure. */ -int sceCdForbidDVDP(u32 *result); +extern int sceCdForbidDVDP(u32 *result); /** Controls automatic adjustment of the CD/DVD drive. * This also causes the auto-tilt motor (on units that have one) to be activated. @@ -707,7 +707,7 @@ int sceCdForbidDVDP(u32 *result); * @param result Result code. * @return 1 on success, 0 on failure. */ -int sceCdAutoAdjustCtrl(int mode, u32 *result); +extern int sceCdAutoAdjustCtrl(int mode, u32 *result); /** Controls on-the-fly (hardware) data decryption. Setting all options to 0 will disable decryption. * This is used for decrypting encrypted sectors like the PlayStation 2 logo. @@ -717,7 +717,7 @@ int sceCdAutoAdjustCtrl(int mode, u32 *result); * @param shiftval Shift amount enable_shift is enabled * @return 1 on success, 0 on failure. */ -int sceCdDecSet(unsigned char enable_xor, unsigned char enable_shift, unsigned char shiftval); +extern int sceCdDecSet(unsigned char enable_xor, unsigned char enable_shift, unsigned char shiftval); /** Reads the requested key from the CD/DVD. * @@ -727,7 +727,7 @@ int sceCdDecSet(unsigned char enable_xor, unsigned char enable_shift, unsigned c * @param key Buffer to store the key in. * @return 1 on success, 0 on failure. */ -int sceCdReadKey(unsigned char arg1, unsigned char arg2, unsigned int command, unsigned char *key); +extern int sceCdReadKey(unsigned char arg1, unsigned char arg2, unsigned int command, unsigned char *key); /** Determines if unique disc key exists * Unofficial name. @@ -736,14 +736,14 @@ int sceCdReadKey(unsigned char arg1, unsigned char arg2, unsigned int command, u * @param status Command status * @return 1 on success, 0 on failure. */ -int sceCdDoesUniqueKeyExist(u32 *status); +extern int sceCdDoesUniqueKeyExist(u32 *status); /** Blocks disc tray eject functionality and turns off the blue eject LED when enabled. * * @param mode Set to a non-zero value to enable the tray eject functionality * @return 1 on success, 0 on failure. */ -int sceCdSetHDMode(u32 mode); +extern int sceCdSetHDMode(u32 mode); /** Opens a specified configuration block, within NVRAM. Each block is 15 bytes long. * @@ -753,14 +753,14 @@ int sceCdSetHDMode(u32 mode); * @param status Result code. * @return 1 on success, 0 on failure. */ -int sceCdOpenConfig(int block, int mode, int NumBlocks, u32 *status); +extern int sceCdOpenConfig(int block, int mode, int NumBlocks, u32 *status); /** Closes the configuration block that is currently opened. * * @param result Result code. * @return 1 on success, 0 on failure. */ -int sceCdCloseConfig(u32 *result); +extern int sceCdCloseConfig(u32 *result); /** Reads the configuration block(s) that was/were previously opened. Each block is 15 bytes long. * @@ -768,7 +768,7 @@ int sceCdCloseConfig(u32 *result); * @param result Result code. * @return 1 on success, 0 on failure. */ -int sceCdReadConfig(void *buffer, u32 *result); +extern int sceCdReadConfig(void *buffer, u32 *result); /** Writes to the configuration block(s) that was/were previously opened. Each block is 15 bytes long. * @@ -776,7 +776,7 @@ int sceCdReadConfig(void *buffer, u32 *result); * @param result Result code. * @return 1 on success, 0 on failure. */ -int sceCdWriteConfig(const void *buffer, u32 *result); +extern int sceCdWriteConfig(const void *buffer, u32 *result); /** Reads a single word from the NVRAM storage. * @@ -785,7 +785,7 @@ int sceCdWriteConfig(const void *buffer, u32 *result); * @param result Result code. * @return 1 on success, 0 on failure. */ -int sceCdReadNVM(u32 address, u16 *data, u8 *result); +extern int sceCdReadNVM(u32 address, u16 *data, u8 *result); /** Writes a single word to the NVRAM storage. * Starting from Mechacon firmware version 50000, attempting to write to address values over 150 will error. @@ -795,7 +795,7 @@ int sceCdReadNVM(u32 address, u16 *data, u8 *result); * @param result Result code. * @return 1 on success, 0 on failure. */ -int sceCdWriteNVM(u32 address, u16 data, u8 *result); +extern int sceCdWriteNVM(u32 address, u16 data, u8 *result); /** Reads the i.Link ID of the console. * All consoles have an i.Link ID, including those that do not have a physical i.Link port. @@ -804,7 +804,7 @@ int sceCdWriteNVM(u32 address, u16 data, u8 *result); * @param result Result code. * @return 1 on success, 0 on failure. */ -int sceCdRI(u8 *buffer, u32 *result); +extern int sceCdRI(u8 *buffer, u32 *result); /** Writes a new i.Link ID for the console. * Starting from Mechacon firmware version 50000, a unlock combination (0x03 0x46 and 0x03 0x47) needs to be executed first. @@ -813,7 +813,7 @@ int sceCdRI(u8 *buffer, u32 *result); * @param result Result code. * @return 1 on success, 0 on failure. */ -int sceCdWI(const u8 *buffer, u32 *result); +extern int sceCdWI(const u8 *buffer, u32 *result); /** Reads the ID of the console. This is not the same as the i.Link ID. * @@ -821,7 +821,7 @@ int sceCdWI(const u8 *buffer, u32 *result); * @param result Result code. * @return 1 on success, 0 on failure. */ -int sceCdReadConsoleID(u8 *buffer, u32 *result); +extern int sceCdReadConsoleID(u8 *buffer, u32 *result); /** Writes a new ID for the console. This is not the same as the i.Link ID. * Starting from Mechacon firmware version 50000, a unlock combination (0x03 0x46 and 0x03 0x47) needs to be executed first. @@ -830,7 +830,7 @@ int sceCdReadConsoleID(u8 *buffer, u32 *result); * @param status Result code. * @return 1 on success, 0 on failure. */ -int sceCdWriteConsoleID(const u8 *buffer, u32 *status); +extern int sceCdWriteConsoleID(const u8 *buffer, u32 *status); /** Controls Audio Digital output. * @@ -838,7 +838,7 @@ int sceCdWriteConsoleID(const u8 *buffer, u32 *status); * @param status Result code. * @return 1 on success, 0 on failure. */ -int sceCdCtrlADout(int mode, u32 *status); +extern int sceCdCtrlADout(int mode, u32 *status); /** Reads MECHACON version data (RR MM mm TT): RR = Magicgate region, MM = major, mm = minor, TT = system type (00 = PS2, 01 = PSX) * Magicgate region codes are: 00 = Japan, 01 = USA, 02 = Europe, 03 = Oceania, 04 = Asia, 05 = Russia, 06 = China, and 07 = Mexico. @@ -849,7 +849,7 @@ int sceCdCtrlADout(int mode, u32 *status); * @param status Result code. * @return 1 on success, 0 on failure. */ -int sceCdMV(u8 *buffer, u32 *status); +extern int sceCdMV(u8 *buffer, u32 *status); /** Performs bootup certification. * SUPPORTED IN XCDVDMAN/XCDVDFSV ONLY @@ -861,7 +861,7 @@ int sceCdMV(u8 *buffer, u32 *status); * romname[3] - Console type (E.g. C, D or T). * @return 1 on success, 0 on failure. */ -int sceCdBootCertify(const u8 *romname); +extern int sceCdBootCertify(const u8 *romname); /** Reads the console's model "name": e.g. "SCPH-39000". * SUPPORTED IN XCDVDMAN/XCDVDFSV ONLY @@ -870,7 +870,7 @@ int sceCdBootCertify(const u8 *romname); * @param status Result code. * @return 1 on success, 0 on failure. */ -int sceCdRM(char *buffer, u32 *status); +extern int sceCdRM(char *buffer, u32 *status); /** Sets the console's model name. * Starting from Mechacon firmware version 50000, a unlock combination (0x03 0x46 and 0x03 0x47) needs to be executed first. @@ -880,7 +880,7 @@ int sceCdRM(char *buffer, u32 *status); * @param status Result code. * @return 1 on success, 0 on failure. */ -int sceCdWM(const char *buffer, u32 *status); +extern int sceCdWM(const char *buffer, u32 *status); /** Disables (Forbids) the READ N-command, so that disc sectors cannot be read. * Support for the READ N-command is re-enabled when the disc is replaced. @@ -889,7 +889,7 @@ int sceCdWM(const char *buffer, u32 *status); * @param result Result code. * @return 1 on success, 0 on failure. */ -int sceCdForbidRead(u32 *result); +extern int sceCdForbidRead(u32 *result); // **** Extra Functions **** @@ -902,7 +902,7 @@ int sceCdForbidRead(u32 *result); * @param mode mode to read in * @return 1 on success, 0 on failure. */ -int sceCdReadFull(unsigned int lsn, unsigned int sectors, void *buf, sceCdRMode *mode); +extern int sceCdReadFull(unsigned int lsn, unsigned int sectors, void *buf, sceCdRMode *mode); /** Seeks to a given position * SUPPORTED IN NEWER CDVDMAN MODULES INCLUDED WITHIN NEWER IOPRP ONLY @@ -910,7 +910,7 @@ int sceCdReadFull(unsigned int lsn, unsigned int sectors, void *buf, sceCdRMode * @param lsn sector location to seek to * @return 1 on success, 0 on failure. */ -int sceCdStSeekF(unsigned int lsn); +extern int sceCdStSeekF(unsigned int lsn); /** Sets a handler for the power-off event which will be called before the console switches off. * SUPPORTED IN NEWER CDVDMAN MODULES INCLUDED WITHIN NEWER IOPRP ONLY @@ -919,7 +919,7 @@ int sceCdStSeekF(unsigned int lsn); * @param addr an argument which will be passed to the callback function * returns: a pointer to the previous handler function, or a null pointer if nothing has been set eariler */ -void *sceCdPOffCallback(void (*func)(void *), void *addr); +extern void *sceCdPOffCallback(void (*func)(void *), void *addr); /** Sets the timeout lengths for the certain CDVDMAN's operations. * SUPPORTED IN NEWER CDVDMAN MODULES INCLUDED WITHIN NEWER IOPRP ONLY @@ -928,7 +928,7 @@ void *sceCdPOffCallback(void (*func)(void *), void *addr); * @param timeout a timeout value * @return 1 on success, 0 on failure. */ -int sceCdSetTimeout(int param, int timeout); +extern int sceCdSetTimeout(int param, int timeout); /** Reads the Model ID. * SUPPORTED IN NEWER CDVDMAN MODULES INCLUDED WITHIN DNAS IOPRP ONLY @@ -936,7 +936,7 @@ int sceCdSetTimeout(int param, int timeout); * @param id integer where the Model ID is stored. * @return 1 on success, 0 on failure. */ -int sceCdReadModelID(unsigned int *id); +extern int sceCdReadModelID(unsigned int *id); /** Reads the information about DVD disk. * SUPPORTED IN NEWER CDVDMAN MODULES INCLUDED WITHIN NEWER IOPRP ONLY @@ -945,7 +945,7 @@ int sceCdReadModelID(unsigned int *id); * @param layer1_start pointer to variable where the address of the second layer of a dual-layer DVD disc is returned. * @return 1 on success, 0 on failure. */ -int sceCdReadDvdDualInfo(int *on_dual, unsigned int *layer1_start); +extern int sceCdReadDvdDualInfo(int *on_dual, unsigned int *layer1_start); /** Retrieves basic information about a file on CD or the specified layer of DVD media. * SUPPORTED IN NEWER CDVDMAN MODULES INCLUDED WITHIN NEWER IOPRP ONLY @@ -955,14 +955,14 @@ int sceCdReadDvdDualInfo(int *on_dual, unsigned int *layer1_start); * @param layer layer to search (0 for the first layer, 1 for the second layer) * @return 1 on success, 0 on failure. */ -int sceCdLayerSearchFile(sceCdlFILE *fp, const char *path, int layer); +extern int sceCdLayerSearchFile(sceCdlFILE *fp, const char *path, int layer); /** Returns the CD/DVD drive status. * SUPPORTED IN NEWER CDVDMAN MODULES INCLUDED WITHIN NEWER IOPRP ONLY * * @return status */ -int sceCdStatus2(void); +extern int sceCdStatus2(void); /** Reads sectors from CD or DVD disc. * SUPPORTED IN NEWER CDVDMAN MODULES INCLUDED WITHIN NEWER IOPRP ONLY @@ -973,7 +973,7 @@ int sceCdStatus2(void); * @param mode mode to read in * @return 1 on success, 0 on failure. */ -int sceCdRE(unsigned int lsn, unsigned int sectors, void *buf, sceCdRMode *mode); +extern int sceCdRE(unsigned int lsn, unsigned int sectors, void *buf, sceCdRMode *mode); /** Reads a GUID. * SUPPORTED IN NEWER CDVDMAN MODULES INCLUDED WITHIN DNAS IOPRP ONLY @@ -981,7 +981,7 @@ int sceCdRE(unsigned int lsn, unsigned int sectors, void *buf, sceCdRMode *mode) * @param guid u64 integer where the GUID is stored. * @return 1 on success, 0 on failure. */ -int sceCdReadGUID(u64 *guid); +extern int sceCdReadGUID(u64 *guid); /** Controls whether SIRCS remote control input should be translated to SIO2 pad input. * This corresponds to the "Remote Control" "Gameplay Function On/Off" option in OSDSYS. @@ -992,7 +992,7 @@ int sceCdReadGUID(u64 *guid); * @param status Result code. * @return 1 on success, 0 on failure */ -int sceCdRcBypassCtl(int mode, u32 *status); +extern int sceCdRcBypassCtl(int mode, u32 *status); /** Reads wake up time. * Minimum Mechacon firmware version: 50000 @@ -1004,7 +1004,7 @@ int sceCdRcBypassCtl(int mode, u32 *status); * @param flags bit 0 -> disable timer after expiration, bit 1 -> disable timer * @return 1 on success, 0 on failure */ -int sceCdReadWakeUpTime(sceCdCLOCK *clock, u16 *userdata, u32 *wakeupreason, int *flags); +extern int sceCdReadWakeUpTime(sceCdCLOCK *clock, u16 *userdata, u32 *wakeupreason, int *flags); /** Writes wake up time. * Minimum Mechacon firmware version: 50000 @@ -1017,7 +1017,7 @@ int sceCdReadWakeUpTime(sceCdCLOCK *clock, u16 *userdata, u32 *wakeupreason, int * @param flags When 1, disables the timer after it has expired. When 255, disables the timer and sets the seconds value to 0xFF. * @return 1 on success, 0 on failure */ -int sceCdWriteWakeUpTime(const sceCdCLOCK *clock, u16 userdata, int flags); +extern int sceCdWriteWakeUpTime(const sceCdCLOCK *clock, u16 userdata, int flags); /** Disables Mechacon actions performed using the remote control. * The actions that can be specified are poweron, poweroff, reset and eject. @@ -1027,7 +1027,7 @@ int sceCdWriteWakeUpTime(const sceCdCLOCK *clock, u16 userdata, int flags); * * @return 1 on success, 0 on failure */ -int sceRemote2_7(u16 param, u32 *status); +extern int sceRemote2_7(u16 param, u32 *status); /** Retrieves the value set by sceRemote2_7. * Minimum Mechacon firmware version: 50000 @@ -1038,7 +1038,7 @@ int sceRemote2_7(u16 param, u32 *status); * @param status Command status * @return 1 on success, 0 on failure. */ -int sceRemote2_7Get(u32 *param, u32 *status); +extern int sceRemote2_7Get(u32 *param, u32 *status); /** Set the LED state of the face buttons of the console. * The state of the buttons will be reset when the power or eject button is pressed. @@ -1048,7 +1048,7 @@ int sceRemote2_7Get(u32 *param, u32 *status); * @param param The LED state to set. * @return 1 on success, 0 on failure */ -int sceCdSetLEDsMode(u32 param, u32 *result); +extern int sceCdSetLEDsMode(u32 param, u32 *result); /** Reads PS1 boot parameter. * Minimum Mechacon firmware version: 50200 @@ -1056,7 +1056,7 @@ int sceCdSetLEDsMode(u32 param, u32 *result); * * @return 1 on success, 0 on failure */ -int sceCdReadPS1BootParam(u8 *out, u32 *result); +extern int sceCdReadPS1BootParam(u8 *out, u32 *result); /** Sets fan profile. * Minimum Mechacon firmware version: 50400 @@ -1065,7 +1065,7 @@ int sceCdReadPS1BootParam(u8 *out, u32 *result); * @param param param (SCECdvdFanSpeed) * @return 1 on success, 0 on failure */ -int sceCdSetFanProfile(u8 param, u32 *result); +extern int sceCdSetFanProfile(u8 param, u32 *result); /** Sends SCMD 0x1D. Appears to be stubbed in Mechacon firmware 50000. * Minimum Mechacon firmware version: 50000 @@ -1078,14 +1078,14 @@ int sceCdSetFanProfile(u8 param, u32 *result); * @param status Command status * @return 1 on success, 0 on failure. */ -int sceCdSendSCmd1D(int *arg1, unsigned int *arg2, unsigned int *arg3, u32 *status); +extern int sceCdSendSCmd1D(int *arg1, unsigned int *arg2, unsigned int *arg3, u32 *status); /** Change sys. * SUPPORTED BY ONLY DESR/PSX DVR CDVDMAN MODULES * * @return 1 on success, 0 on failure */ -int sceCdChgSys(u32 arg1); +extern int sceCdChgSys(u32 arg1); /** Notice game start. * Minimum Mechacon firmware version: 50400 @@ -1093,7 +1093,7 @@ int sceCdChgSys(u32 arg1); * * @return 1 on success, 0 on failure */ -int sceCdNoticeGameStart(u8 arg1, u32 *result); +extern int sceCdNoticeGameStart(u8 arg1, u32 *result); /** Extended LED control. * Minimum Mechacon firmware version: 50600 @@ -1101,7 +1101,7 @@ int sceCdNoticeGameStart(u8 arg1, u32 *result); * * @return 1 on success, 0 on failure */ -int sceCdXLEDCtl(u8 arg1, u8 arg2, u32 *result1, u32 *result2); +extern int sceCdXLEDCtl(u8 arg1, u8 arg2, u32 *result1, u32 *result2); /** Buzzer control. * Minimum Mechacon firmware version: 50600 @@ -1109,7 +1109,7 @@ int sceCdXLEDCtl(u8 arg1, u8 arg2, u32 *result1, u32 *result2); * * @return 1 on success, 0 on failure */ -int sceCdBuzzerCtl(u32 *result); +extern int sceCdBuzzerCtl(u32 *result); /** XBS power control. * Minimum Mechacon firmware version: 50600 @@ -1117,7 +1117,7 @@ int sceCdBuzzerCtl(u32 *result); * * @return 1 on success, 0 on failure */ -int sceCdXBSPowerCtl(u8 arg1, u8 arg2, u32 *result1, u32 *result2); +extern int sceCdXBSPowerCtl(u8 arg1, u8 arg2, u32 *result1, u32 *result2); /** Set medium removal. * Minimum Mechacon firmware version: 50600 @@ -1125,7 +1125,7 @@ int sceCdXBSPowerCtl(u8 arg1, u8 arg2, u32 *result1, u32 *result2); * * @return 1 on success, 0 on failure */ -int sceCdSetMediumRemoval(u8 arg1, u32 *result); +extern int sceCdSetMediumRemoval(u8 arg1, u32 *result); /** Get medium removal. * Minimum Mechacon firmware version: 50600 @@ -1133,7 +1133,7 @@ int sceCdSetMediumRemoval(u8 arg1, u32 *result); * * @return 1 on success, 0 on failure */ -int sceCdGetMediumRemoval(u32 *result1, u32 *result2); +extern int sceCdGetMediumRemoval(u32 *result1, u32 *result2); /** XDVRP reset. * Minimum Mechacon firmware version: 50600 @@ -1141,14 +1141,14 @@ int sceCdGetMediumRemoval(u32 *result1, u32 *result2); * * @return 1 on success, 0 on failure */ -int sceCdXDVRPReset(u8 arg1, u32 *result); +extern int sceCdXDVRPReset(u8 arg1, u32 *result); /** Get wake up reason. * SUPPORTED BY ONLY DESR/PSX DVR CDVDMAN MODULES * * @return 1 on success, 0 on failure */ -int sceCdGetWakeUpReason(void); +extern int sceCdGetWakeUpReason(void); /** Reads region parameters. * Minimum Mechacon firmware version: 60000 @@ -1156,7 +1156,7 @@ int sceCdGetWakeUpReason(void); * * @return 1 on success, 0 on failure */ -int sceCdReadRegionParams(u32 *arg1, u32 *result); +extern int sceCdReadRegionParams(u32 *arg1, u32 *result); /** Writes region parameters. * Minimum Mechacon firmware version: 60600 @@ -1164,7 +1164,7 @@ int sceCdReadRegionParams(u32 *arg1, u32 *result); * * @return 1 on success, 0 on failure */ -int sceCdWriteRegionParams(u8 arg1, u32 *arg2, u8 *arg3, u32 *result); +extern int sceCdWriteRegionParams(u8 arg1, u32 *arg2, u8 *arg3, u32 *result); // Compatibility names for older ps2sdk versions. diff --git a/common/include/libsd-common.h b/common/include/libsd-common.h index 7f72de2db78..26fc9f016d4 100644 --- a/common/include/libsd-common.h +++ b/common/include/libsd-common.h @@ -152,47 +152,47 @@ typedef int (*SdIntrCallback)(void *data); extern "C" { #endif -int sceSdQuit(); -int sceSdInit(int flag); -SdIntrCallback sceSdSetIRQCallback(SdIntrCallback cb); -SdIntrCallback sceSdSetTransCallback(s32 core, SdIntrCallback cb); +extern int sceSdQuit(); +extern int sceSdInit(int flag); +extern SdIntrCallback sceSdSetIRQCallback(SdIntrCallback cb); +extern SdIntrCallback sceSdSetTransCallback(s32 core, SdIntrCallback cb); -void sceSdSetParam(u16 entry, u16 value); -u16 sceSdGetParam(u16 entry); +extern void sceSdSetParam(u16 entry, u16 value); +extern u16 sceSdGetParam(u16 entry); -void sceSdSetCoreAttr(u16 entry, u16 value); -u16 sceSdGetCoreAttr(u16 entry); -int sceSdClearEffectWorkArea(int core, int channel, int effect_mode); +extern void sceSdSetCoreAttr(u16 entry, u16 value); +extern u16 sceSdGetCoreAttr(u16 entry); +extern int sceSdClearEffectWorkArea(int core, int channel, int effect_mode); -void sceSdSetAddr(u16 entry, u32 value); -u32 sceSdGetAddr(u16 entry); +extern void sceSdSetAddr(u16 entry, u32 value); +extern u32 sceSdGetAddr(u16 entry); -void sceSdSetSwitch(u16 entry, u32 value); -u32 sceSdGetSwitch(u16 entry); +extern void sceSdSetSwitch(u16 entry, u32 value); +extern u32 sceSdGetSwitch(u16 entry); -u16 sceSdNote2Pitch(u16 center_note, u16 center_fine, u16 note, s16 fine); -u16 sceSdPitch2Note(u16 center_note, u16 center_fine, u16 pitch); +extern u16 sceSdNote2Pitch(u16 center_note, u16 center_fine, u16 note, s16 fine); +extern u16 sceSdPitch2Note(u16 center_note, u16 center_fine, u16 pitch); -int sceSdSetEffectAttr(int core, sceSdEffectAttr *attr); -void sceSdGetEffectAttr(int core, sceSdEffectAttr *attr); +extern int sceSdSetEffectAttr(int core, sceSdEffectAttr *attr); +extern void sceSdGetEffectAttr(int core, sceSdEffectAttr *attr); -int sceSdProcBatch(sceSdBatch *batch, u32 *rets, u32 num); -int sceSdProcBatchEx(sceSdBatch *batch, u32 *rets, u32 num, u32 voice); +extern int sceSdProcBatch(sceSdBatch *batch, u32 *rets, u32 num); +extern int sceSdProcBatchEx(sceSdBatch *batch, u32 *rets, u32 num, u32 voice); -int sceSdVoiceTrans(s16 chan, u16 mode, u8 *iopaddr, u32 *spuaddr, u32 size); -int sceSdBlockTrans(s16 chan, u16 mode, u8 *iopaddr, u32 size, ...); -u32 sceSdVoiceTransStatus(s16 channel, s16 flag); -u32 sceSdBlockTransStatus(s16 channel, s16 flag); +extern int sceSdVoiceTrans(s16 chan, u16 mode, u8 *iopaddr, u32 *spuaddr, u32 size); +extern int sceSdBlockTrans(s16 chan, u16 mode, u8 *iopaddr, u32 size, ...); +extern u32 sceSdVoiceTransStatus(s16 channel, s16 flag); +extern u32 sceSdBlockTransStatus(s16 channel, s16 flag); -sceSdTransIntrHandler sceSdSetTransIntrHandler(int channel, sceSdTransIntrHandler func, void *arg); -sceSdSpu2IntrHandler sceSdSetSpu2IntrHandler(sceSdSpu2IntrHandler func, void *arg); +extern sceSdTransIntrHandler sceSdSetTransIntrHandler(int channel, sceSdTransIntrHandler func, void *arg); +extern sceSdSpu2IntrHandler sceSdSetSpu2IntrHandler(sceSdSpu2IntrHandler func, void *arg); -void *sceSdGetTransIntrHandlerArgument(int arg); -void *sceSdGetSpu2IntrHandlerArgument(); -int sceSdStopTrans(int channel); -int sceSdCleanEffectWorkArea(int core, int channel, int effect_mode); -int sceSdSetEffectMode(int core, sceSdEffectAttr *param); -int sceSdSetEffectModeParams(int core, sceSdEffectAttr *attr); +extern void *sceSdGetTransIntrHandlerArgument(int arg); +extern void *sceSdGetSpu2IntrHandlerArgument(); +extern int sceSdStopTrans(int channel); +extern int sceSdCleanEffectWorkArea(int core, int channel, int effect_mode); +extern int sceSdSetEffectMode(int core, sceSdEffectAttr *param); +extern int sceSdSetEffectModeParams(int core, sceSdEffectAttr *attr); #ifdef __cplusplus } diff --git a/common/include/netman.h b/common/include/netman.h index dacdef4a8c5..6ad27a813ca 100644 --- a/common/include/netman.h +++ b/common/include/netman.h @@ -105,37 +105,37 @@ enum NETMAN_NETIF_IOCTL_CODES { // Initialization and deinitialization functions, for the EE side. #ifdef _EE -int NetManInit(void); -void NetManDeinit(void); +extern int NetManInit(void); +extern void NetManDeinit(void); #endif // Network Interface (IF) control. -int NetManGetGlobalNetIFLinkState(void); -int NetManSetMainIF(const char *name); -int NetManQueryMainIF(char *name); +extern int NetManGetGlobalNetIFLinkState(void); +extern int NetManSetMainIF(const char *name); +extern int NetManQueryMainIF(char *name); //*** System functions for either the Network IF driver or the network protocol stack *** // For the network protocol stack to initialize/deinitialize NETMAN. -int NetManRegisterNetworkStack(const struct NetManNetProtStack *stack); -void NetManUnregisterNetworkStack(void); +extern int NetManRegisterNetworkStack(const struct NetManNetProtStack *stack); +extern void NetManUnregisterNetworkStack(void); /* Common network Interface (IF) management functions. Used by the user program and the protocol stack. */ -int NetManIoctl(unsigned int command, void *args, unsigned int args_len, void *output, unsigned int length); -int NetManSetLinkMode(int mode); +extern int NetManIoctl(unsigned int command, void *args, unsigned int args_len, void *output, unsigned int length); +extern int NetManSetLinkMode(int mode); /* Network Interface (IF) management functions. Used by the protocol stack. */ -void NetManNetIFXmit(void); // Notify the interface of available packets. May be called from the interrupt context. +extern void NetManNetIFXmit(void); // Notify the interface of available packets. May be called from the interrupt context. /* Network protocol stack management functions. Used by the Network InterFace (IF) driver. */ -void *NetManNetProtStackAllocRxPacket(unsigned int length, void **payload); -void NetManNetProtStackFreeRxPacket(void *packet); -void NetManNetProtStackEnQRxPacket(void *packet); -int NetManTxPacketNext(void **payload); -void NetManTxPacketDeQ(void); +extern void *NetManNetProtStackAllocRxPacket(unsigned int length, void **payload); +extern void NetManNetProtStackFreeRxPacket(void *packet); +extern void NetManNetProtStackEnQRxPacket(void *packet); +extern int NetManTxPacketNext(void **payload); +extern void NetManTxPacketDeQ(void); -int NetManTxPacketAfter(void **payload); // For EE only, for NETMAN's internal use. -void NetManNetProtStackReallocRxPacket(void *packet, unsigned int length); // For EE only, for NETMAN's internal use. +extern int NetManTxPacketAfter(void **payload); // For EE only, for NETMAN's internal use. +extern void NetManNetProtStackReallocRxPacket(void *packet, unsigned int length); // For EE only, for NETMAN's internal use. /* NETIF flags. */ /** Set internally by NETMAN. Do not set externally. */ @@ -167,9 +167,9 @@ struct NetManNetIF #define NETMAN_MAX_NETIF_COUNT 2 /* Network InterFace (IF) management functions. Used by the network InterFace (IF). */ -int NetManRegisterNetIF(struct NetManNetIF *NetIF); -void NetManUnregisterNetIF(const char *name); -void NetManToggleNetIFLinkState(int NetIFID, unsigned char state); // Also toggles NETMAN_NETIF_EVF_UP and NETMAN_NETIF_EVF_DOWN +extern int NetManRegisterNetIF(struct NetManNetIF *NetIF); +extern void NetManUnregisterNetIF(const char *name); +extern void NetManToggleNetIFLinkState(int NetIFID, unsigned char state); // Also toggles NETMAN_NETIF_EVF_UP and NETMAN_NETIF_EVF_DOWN #ifdef _IOP diff --git a/common/include/ps2snd.h b/common/include/ps2snd.h index 0971593edd5..06319caa25b 100644 --- a/common/include/ps2snd.h +++ b/common/include/ps2snd.h @@ -66,18 +66,18 @@ extern "C" { #endif #ifdef _EE -int sndLoadSample(void *buf, u32 spuaddr, int size); -u32 sndQueryMaxFreeMemSize(void); +extern int sndLoadSample(void *buf, u32 spuaddr, int size); +extern u32 sndQueryMaxFreeMemSize(void); #endif -int sndStreamOpen(char *file, u32 voices, u32 flags, u32 bufaddr, u32 bufsize); -int sndStreamClose(void); -int sndStreamPlay(void); -int sndStreamPause(void); -int sndStreamSetPosition(int block); -int sndStreamGetPosition(void); -int sndStreamSetVolume(int left, int right); -u32 sndQueryMaxFreeMemSize(); +extern int sndStreamOpen(char *file, u32 voices, u32 flags, u32 bufaddr, u32 bufsize); +extern int sndStreamClose(void); +extern int sndStreamPlay(void); +extern int sndStreamPause(void); +extern int sndStreamSetPosition(int block); +extern int sndStreamGetPosition(void); +extern int sndStreamSetVolume(int left, int right); +extern u32 sndQueryMaxFreeMemSize(); #ifdef __cplusplus } diff --git a/common/include/sys/random.h b/common/include/sys/random.h index 8b450bf5fcb..80f6e46c068 100644 --- a/common/include/sys/random.h +++ b/common/include/sys/random.h @@ -21,7 +21,7 @@ extern "C" { #endif -ssize_t getrandom (void *buf, size_t buflen, unsigned int flags); +extern ssize_t getrandom (void *buf, size_t buflen, unsigned int flags); #ifdef __cplusplus } diff --git a/common/sbus/include/ps2_sbus.h b/common/sbus/include/ps2_sbus.h index b547edb1cac..bf35b2e2e0b 100644 --- a/common/sbus/include/ps2_sbus.h +++ b/common/sbus/include/ps2_sbus.h @@ -45,26 +45,26 @@ typedef struct st_SIF2_CmdHandler } SIF2_CmdHandler; // SBUS -int SBUS_init(void); -int SBUS_deinit(void); -void *SBUS_set_irq_handler(int irq, SBUS_IrqHandlerFunc func, void *param); -int SBUS_rem_irq_handler(int irq); -u32 SBUS_get_reg(int reg_no); -void SBUS_set_reg(int reg_no, u32 val); -int SBUS_interrupt_remote(int irq); +extern int SBUS_init(void); +extern int SBUS_deinit(void); +extern void *SBUS_set_irq_handler(int irq, SBUS_IrqHandlerFunc func, void *param); +extern int SBUS_rem_irq_handler(int irq); +extern u32 SBUS_get_reg(int reg_no); +extern void SBUS_set_reg(int reg_no, u32 val); +extern int SBUS_interrupt_remote(int irq); // SIF2 -int SIF2_init(void); -int SIF2_deinit(void); -int SIF2_set_dma(u32 addr, u32 size, u32 attr); -void SIF2_sync_dma(void); +extern int SIF2_init(void); +extern int SIF2_deinit(void); +extern int SIF2_set_dma(u32 addr, u32 size, u32 attr); +extern void SIF2_sync_dma(void); // SIF2 Command -int SIF2_init_cmd(void); -int SIF2_set_cmd_handler(int cid, SIF2_CmdHandlerFunc func, void *param); -int SIF2_rem_cmd_handler(int cid); -void SIF2_send_cmd(u32 cid, void *extra, int extra_size); -void SBUS_check_intr(void); +extern int SIF2_init_cmd(void); +extern int SIF2_set_cmd_handler(int cid, SIF2_CmdHandlerFunc func, void *param); +extern int SIF2_rem_cmd_handler(int cid); +extern void SIF2_send_cmd(u32 cid, void *extra, int extra_size); +extern void SBUS_check_intr(void); // SBUS #define I_SBUS_init DECLARE_IMPORT(4, SBUS_init) diff --git a/ee/debug/include/debug.h b/ee/debug/include/debug.h index a11a303674f..990d66dee78 100644 --- a/ee/debug/include/debug.h +++ b/ee/debug/include/debug.h @@ -25,22 +25,22 @@ extern "C" { #endif -void init_scr(void); -void scr_printf(const char *, ...) __attribute__((format(printf,1,2))); -void scr_vprintf(const char *format, va_list opt); -void scr_putchar(int x, int y, u32 color, int ch); -void ps2GetStackTrace(unsigned int* results,int max); -void scr_setXY(int x, int y); -int scr_getX(void); -int scr_getY(void); -void scr_clear(void); -void scr_clearline(int Y); -void scr_clearchar(int X, int Y); -void scr_setbgcolor(u32 color); -void scr_setfontcolor(u32 color); -void scr_setcursorcolor(u32 color); -void scr_setCursor(int enable); -int scr_getCursor(void); +extern void init_scr(void); +extern void scr_printf(const char *, ...) __attribute__((format(printf,1,2))); +extern void scr_vprintf(const char *format, va_list opt); +extern void scr_putchar(int x, int y, u32 color, int ch); +extern void ps2GetStackTrace(unsigned int* results,int max); +extern void scr_setXY(int x, int y); +extern int scr_getX(void); +extern int scr_getY(void); +extern void scr_clear(void); +extern void scr_clearline(int Y); +extern void scr_clearchar(int X, int Y); +extern void scr_setbgcolor(u32 color); +extern void scr_setfontcolor(u32 color); +extern void scr_setcursorcolor(u32 color); +extern void scr_setCursor(int enable); +extern int scr_getCursor(void); #ifdef __cplusplus } #endif diff --git a/ee/debug/include/hwbp.h b/ee/debug/include/hwbp.h index 8900bad238c..4b72ca75085 100644 --- a/ee/debug/include/hwbp.h +++ b/ee/debug/include/hwbp.h @@ -65,46 +65,46 @@ extern "C" { #endif /** Initialise the Breakpoint controller */ -void InitBPC(void); +extern void InitBPC(void); /** Set an instruction BP */ -void SetInstructionBP(u32 addr, u32 mask, u32 options); +extern void SetInstructionBP(u32 addr, u32 mask, u32 options); /** Set a data address BP * * Options is one or more of the BPC settings for data address * Note you must set BPC_DRE and/or BPC_DWE in the options */ -void SetDataAddrBP(u32 addr, u32 mask, u32 options); +extern void SetDataAddrBP(u32 addr, u32 mask, u32 options); /** Set a data value BP */ -void SetDataValueBP(u32 addr, u32 mask, u32 value, u32 vmask, u32 options); +extern void SetDataValueBP(u32 addr, u32 mask, u32 value, u32 vmask, u32 options); /** Get the BPC register */ -u32 GetBPC(void); +extern u32 GetBPC(void); /** Set the BPC register */ -void SetBPC(u32 bpc); +extern void SetBPC(u32 bpc); /** Get the instruction address register */ -u32 GetIAB(void); +extern u32 GetIAB(void); /** Set the instruction address register */ -void SetIAB(u32 val); +extern void SetIAB(u32 val); /** Get the instruction address mask register */ -u32 GetIABM(void); +extern u32 GetIABM(void); /** Set the instruction address mask register */ -void SetIABM(u32 val); +extern void SetIABM(u32 val); /** Get the data address register */ -u32 GetDAB(void); +extern u32 GetDAB(void); /** Set the data address register */ -void SetDAB(u32 val); +extern void SetDAB(u32 val); /** Get the data address register */ -u32 GetDABM(void); +extern u32 GetDABM(void); /** Set the data address mask register */ -void SetDABM(u32 val); +extern void SetDABM(u32 val); /** Get the data value mask register */ -u32 GetDVB(void); +extern u32 GetDVB(void); /** Set the data value register */ -void SetDVB(u32 val); +extern void SetDVB(u32 val); /** Get the data value mask register */ -u32 GetDVBM(void); +extern u32 GetDVBM(void); /** Set the data value mask register */ -void SetDVBM(u32 val); +extern void SetDVBM(u32 val); #ifdef __cplusplus } diff --git a/ee/debug/include/screenshot.h b/ee/debug/include/screenshot.h index b34ba24ca10..4fdb6569b37 100644 --- a/ee/debug/include/screenshot.h +++ b/ee/debug/include/screenshot.h @@ -20,10 +20,10 @@ extern "C" { #endif -int ps2_screenshot_file( const char* pFilename,unsigned int VramAdress, +extern int ps2_screenshot_file( const char* pFilename,unsigned int VramAdress, unsigned int Width, unsigned int Height, unsigned int Psm ); -int ps2_screenshot( void* pTemp, unsigned int VramAdress,unsigned int x,unsigned int y, +extern int ps2_screenshot( void* pTemp, unsigned int VramAdress,unsigned int x,unsigned int y, unsigned int Width, unsigned int Height, unsigned int Psm ); #ifdef __cplusplus diff --git a/ee/dma/include/dma.h b/ee/dma/include/dma.h index 0543d707087..b530d1aa636 100644 --- a/ee/dma/include/dma.h +++ b/ee/dma/include/dma.h @@ -37,19 +37,19 @@ extern "C" { #endif -int dma_reset(void); +extern int dma_reset(void); /** Initializes the specified dma channel. */ -int dma_channel_initialize(int channel, void *handler, int flags); +extern int dma_channel_initialize(int channel, void *handler, int flags); /** Enables dma fast waits for that channel */ -void dma_channel_fast_waits(int channel); +extern void dma_channel_fast_waits(int channel); /** Waits until channel is usable based on coprocessor status */ -void dma_wait_fast(void); +extern void dma_wait_fast(void); /** Wait until the specified dma channel is ready. */ -int dma_channel_wait(int channel, int timeout); +extern int dma_channel_wait(int channel, int timeout); /** * Send packet2. @@ -58,28 +58,28 @@ int dma_channel_wait(int channel, int timeout); * @param channel DMA channel. * @param flush_cache Should be cache flushed before send? */ -void dma_channel_send_packet2(packet2_t *packet2, int channel, u8 flush_cache); +extern void dma_channel_send_packet2(packet2_t *packet2, int channel, u8 flush_cache); /** Send a dmachain to the specified dma channel. */ -int dma_channel_send_chain(int channel, void *data, int qwc, int flags, int spr); +extern int dma_channel_send_chain(int channel, void *data, int qwc, int flags, int spr); /** Send a ucab dmachain to the specified dma channel. */ -int dma_channel_send_chain_ucab(int channel, void *data, int qwc, int flags); +extern int dma_channel_send_chain_ucab(int channel, void *data, int qwc, int flags); /** Send data to the specified dma channel. */ -int dma_channel_send_normal(int channel, void *data, int qwc, int flags, int spr); +extern int dma_channel_send_normal(int channel, void *data, int qwc, int flags, int spr); /** Send ucab data to the specified dma channel. */ -int dma_channel_send_normal_ucab(int channel, void *data, int qwc, int flags); +extern int dma_channel_send_normal_ucab(int channel, void *data, int qwc, int flags); /** Receive data from the specified dma channel. */ -int dma_channel_receive_normal(int channel, void *data, int data_size, int flags, int spr); +extern int dma_channel_receive_normal(int channel, void *data, int data_size, int flags, int spr); /** Receive data from the specified dma channel. */ -int dma_channel_receive_chain(int channel, void *data, int data_size, int flags, int spr); +extern int dma_channel_receive_chain(int channel, void *data, int data_size, int flags, int spr); /** Shut down the specified dma channel. */ -int dma_channel_shutdown(int channel, int flags); +extern int dma_channel_shutdown(int channel, int flags); #ifdef __cplusplus } diff --git a/ee/draw/include/draw.h b/ee/draw/include/draw.h index 662e149d7e5..e895c8c5485 100644 --- a/ee/draw/include/draw.h +++ b/ee/draw/include/draw.h @@ -29,22 +29,22 @@ extern "C" { #endif /** Sets up the drawing environment based on the framebuffer and zbuffer settings */ -qword_t *draw_setup_environment(qword_t *q, int context, framebuffer_t *frame, zbuffer_t *z); +extern qword_t *draw_setup_environment(qword_t *q, int context, framebuffer_t *frame, zbuffer_t *z); /** Clear the screen based on the screen's origin, width, and height using the defined color. **/ -qword_t *draw_clear(qword_t *q, int context, float x, float y, float width, float height, int r, int g, int b); +extern qword_t *draw_clear(qword_t *q, int context, float x, float y, float width, float height, int r, int g, int b); /** Signal that drawing is finished */ -qword_t *draw_finish(qword_t *q); +extern qword_t *draw_finish(qword_t *q); /** Wait until finish event occurs */ -void draw_wait_finish(void); +extern void draw_wait_finish(void); /** Creates a dma chain filled with image information */ -qword_t *draw_texture_transfer(qword_t *q, void *src, int width, int height, int psm, int dest, int dest_width); +extern qword_t *draw_texture_transfer(qword_t *q, void *src, int width, int height, int psm, int dest, int dest_width); /** Flush the texture cache */ -qword_t *draw_texture_flush(qword_t *q); +extern qword_t *draw_texture_flush(qword_t *q); #ifdef __cplusplus } diff --git a/ee/draw/include/draw2d.h b/ee/draw/include/draw2d.h index 79c9da91bb7..67cdf6429c2 100644 --- a/ee/draw/include/draw2d.h +++ b/ee/draw/include/draw2d.h @@ -47,51 +47,51 @@ extern "C" { #endif /** Enables alpha blending */ -void draw_enable_blending(); +extern void draw_enable_blending(); /** Disables alpha blending */ -void draw_disable_blending(); +extern void draw_disable_blending(); /** Draws a single point */ -qword_t *draw_point(qword_t *q, int context, point_t *point); +extern qword_t *draw_point(qword_t *q, int context, point_t *point); /** Draws a single line */ -qword_t *draw_line(qword_t *q, int context, line_t *line); +extern qword_t *draw_line(qword_t *q, int context, line_t *line); /** Draws a triangle using a line strip */ -qword_t *draw_triangle_outline(qword_t *q, int context, triangle_t *triangle); +extern qword_t *draw_triangle_outline(qword_t *q, int context, triangle_t *triangle); /** Draws a single triangle */ -qword_t *draw_triangle_filled(qword_t *q, int context,triangle_t *triangle); +extern qword_t *draw_triangle_filled(qword_t *q, int context,triangle_t *triangle); /** Draws a rectangle using line primitives */ -qword_t *draw_rect_outline(qword_t *q, int context, rect_t *rect); +extern qword_t *draw_rect_outline(qword_t *q, int context, rect_t *rect); /** Draws a single sprite */ -qword_t *draw_rect_filled(qword_t *q, int context, rect_t *rect); +extern qword_t *draw_rect_filled(qword_t *q, int context, rect_t *rect); /** Draws a single texture mapped sprite */ -qword_t *draw_rect_textured(qword_t *q, int context, texrect_t *rect); +extern qword_t *draw_rect_textured(qword_t *q, int context, texrect_t *rect); /** Draws multiple sprite primitives */ -qword_t *draw_rect_filled_strips(qword_t *q, int context, rect_t *rect); +extern qword_t *draw_rect_filled_strips(qword_t *q, int context, rect_t *rect); /** Draws multiple strips to render a large texture * width must be multiple of 32 - 0.9375 */ -qword_t *draw_rect_textured_strips(qword_t *q, int context, texrect_t *rect); +extern qword_t *draw_rect_textured_strips(qword_t *q, int context, texrect_t *rect); /** Draws filled round rectangle, buggy with partial coordinates */ -qword_t *draw_round_rect_filled(qword_t *q, int context, rect_t *rect); +extern qword_t *draw_round_rect_filled(qword_t *q, int context, rect_t *rect); /** Draws a hollow round rectangle, buggy with partial coordinates */ -qword_t *draw_round_rect_outline(qword_t *q, int context, rect_t *rect); +extern qword_t *draw_round_rect_outline(qword_t *q, int context, rect_t *rect); /** Draws an arc using line primitives */ -qword_t *draw_arc_outline(qword_t *q, int context, point_t *center, float radius, float angle_start, float angle_end); +extern qword_t *draw_arc_outline(qword_t *q, int context, point_t *center, float radius, float angle_start, float angle_end); /** Draws multiple triangle fans */ -qword_t *draw_arc_filled(qword_t *q, int context, point_t *center, float radius, float angle_start, float angle_end); +extern qword_t *draw_arc_filled(qword_t *q, int context, point_t *center, float radius, float angle_start, float angle_end); #ifdef __cplusplus } diff --git a/ee/draw/include/draw3d.h b/ee/draw/include/draw3d.h index 091763b7b37..e30d323c2bf 100644 --- a/ee/draw/include/draw3d.h +++ b/ee/draw/include/draw3d.h @@ -62,22 +62,22 @@ extern "C" { #endif /** Begins a primitive, allowing for vertex data to be filled in the packet directly */ -qword_t *draw_prim_start(qword_t *q, int context, prim_t *prim, color_t *color); +extern qword_t *draw_prim_start(qword_t *q, int context, prim_t *prim, color_t *color); /** Ends a primitive by calculating the number of qwords used, the number of registers, the register list */ -qword_t *draw_prim_end(qword_t *q,int nreg, u64 reglist); +extern qword_t *draw_prim_end(qword_t *q,int nreg, u64 reglist); /** Converts floating point color, replacing alpha with constant value, and calculates q */ -int draw_convert_rgbq(color_t *output, int count, vertex_f_t *vertices, color_f_t *colours, unsigned char alpha); +extern int draw_convert_rgbq(color_t *output, int count, vertex_f_t *vertices, color_f_t *colours, unsigned char alpha); /** Converts floating point color and calculates q value */ -int draw_convert_rgbaq(color_t *output, int count, vertex_f_t *vertices, color_f_t *colours); +extern int draw_convert_rgbaq(color_t *output, int count, vertex_f_t *vertices, color_f_t *colours); /** Calculates the st coordinates from the perspective coordinate q = 1/w */ -int draw_convert_st(texel_t *output, int count, vertex_f_t *vertices, texel_f_t *coords); +extern int draw_convert_st(texel_t *output, int count, vertex_f_t *vertices, texel_f_t *coords); /** Converts and translates floating point vertices to fixed point vertices */ -int draw_convert_xyz(xyz_t *output, float x, float y, int z, int count, vertex_f_t *vertices); +extern int draw_convert_xyz(xyz_t *output, float x, float y, int z, int count, vertex_f_t *vertices); #ifdef __cplusplus } diff --git a/ee/draw/include/draw_blending.h b/ee/draw/include/draw_blending.h index 47831d7d162..2ec6b202718 100644 --- a/ee/draw/include/draw_blending.h +++ b/ee/draw/include/draw_blending.h @@ -36,13 +36,13 @@ extern "C" { #endif /** Alpha Blending Per-Pixel MSB Control */ -qword_t *draw_pixel_alpha_control(qword_t *q, int enable); +extern qword_t *draw_pixel_alpha_control(qword_t *q, int enable); /** Alpha Blending */ -qword_t *draw_alpha_blending(qword_t *q, int context, blend_t *blend); +extern qword_t *draw_alpha_blending(qword_t *q, int context, blend_t *blend); /** Alpha Correction */ -qword_t *draw_alpha_correction(qword_t *q, int context, int alpha); +extern qword_t *draw_alpha_correction(qword_t *q, int context, int alpha); #ifdef __cplusplus } diff --git a/ee/draw/include/draw_buffers.h b/ee/draw/include/draw_buffers.h index 7896d97fb26..ab95ad182aa 100644 --- a/ee/draw/include/draw_buffers.h +++ b/ee/draw/include/draw_buffers.h @@ -73,22 +73,22 @@ extern "C" { #endif /** Returns the power of 2 needed for texture width and height */ -unsigned char draw_log2(unsigned int x); +extern unsigned char draw_log2(unsigned int x); /** Framebuffer Attributes */ -qword_t *draw_framebuffer(qword_t *q, int context, framebuffer_t *frame); +extern qword_t *draw_framebuffer(qword_t *q, int context, framebuffer_t *frame); /** ZBuffer Attributes */ -qword_t *draw_zbuffer(qword_t *q, int context, zbuffer_t *zbuffer); +extern qword_t *draw_zbuffer(qword_t *q, int context, zbuffer_t *zbuffer); /** TextureBuffer Attributes */ -qword_t *draw_texturebuffer(qword_t *q, int context, texbuffer_t *texbuffer, clutbuffer_t *clut); +extern qword_t *draw_texturebuffer(qword_t *q, int context, texbuffer_t *texbuffer, clutbuffer_t *clut); /** CLUT Storage Mode 1 Information */ -qword_t *draw_clutbuffer(qword_t *q, int context, int psm, clutbuffer_t *clut); +extern qword_t *draw_clutbuffer(qword_t *q, int context, int psm, clutbuffer_t *clut); /** CLUT Storage Mode 2 Information */ -qword_t *draw_clut_offset(qword_t *q, int cbw, int u, int v); +extern qword_t *draw_clut_offset(qword_t *q, int cbw, int u, int v); #ifdef __cplusplus } diff --git a/ee/draw/include/draw_dithering.h b/ee/draw/include/draw_dithering.h index 21f54a42d08..9b809e14224 100644 --- a/ee/draw/include/draw_dithering.h +++ b/ee/draw/include/draw_dithering.h @@ -15,10 +15,10 @@ extern "C" { #endif /** Dithering Switch */ -qword_t *draw_dithering(qword_t *q, int enable); +extern qword_t *draw_dithering(qword_t *q, int enable); /** Dithering Matrix */ -qword_t *draw_dither_matrix(qword_t *q,char *dm); +extern qword_t *draw_dither_matrix(qword_t *q,char *dm); #ifdef __cplusplus } diff --git a/ee/draw/include/draw_fog.h b/ee/draw/include/draw_fog.h index e7821c58dc3..d0b8a001a96 100644 --- a/ee/draw/include/draw_fog.h +++ b/ee/draw/include/draw_fog.h @@ -13,7 +13,7 @@ extern "C" { #endif /** Fog Color */ -qword_t *draw_fog_color(qword_t *q, unsigned char r, unsigned char g, unsigned char b); +extern qword_t *draw_fog_color(qword_t *q, unsigned char r, unsigned char g, unsigned char b); #ifdef __cplusplus } diff --git a/ee/draw/include/draw_masking.h b/ee/draw/include/draw_masking.h index 01fab512451..a4b7fce5937 100644 --- a/ee/draw/include/draw_masking.h +++ b/ee/draw/include/draw_masking.h @@ -22,10 +22,10 @@ extern "C" { #endif /** Scanline Masking (framebuffer) */ -qword_t *draw_scan_masking(qword_t *q, int mask); +extern qword_t *draw_scan_masking(qword_t *q, int mask); /** Color Masking/Clamping */ -qword_t *draw_color_clamping(qword_t *q, int enable); +extern qword_t *draw_color_clamping(qword_t *q, int enable); #ifdef __cplusplus } diff --git a/ee/draw/include/draw_primitives.h b/ee/draw/include/draw_primitives.h index 107c49bfd5a..7251b80cbf6 100644 --- a/ee/draw/include/draw_primitives.h +++ b/ee/draw/include/draw_primitives.h @@ -49,13 +49,13 @@ extern "C" { #endif /** Primitive Coordinate System offset */ -qword_t *draw_primitive_xyoffset(qword_t *q, int context, float x, float y); +extern qword_t *draw_primitive_xyoffset(qword_t *q, int context, float x, float y); /** Primitive Control */ -qword_t *draw_primitive_override(qword_t *q, int mode); +extern qword_t *draw_primitive_override(qword_t *q, int mode); /** Overridden Primitive Attributes */ -qword_t *draw_primitive_override_setting(qword_t *q, int context, prim_t *prim); +extern qword_t *draw_primitive_override_setting(qword_t *q, int context, prim_t *prim); #ifdef __cplusplus } diff --git a/ee/draw/include/draw_sampling.h b/ee/draw/include/draw_sampling.h index 3f28651d9b0..910c5a2befc 100644 --- a/ee/draw/include/draw_sampling.h +++ b/ee/draw/include/draw_sampling.h @@ -67,19 +67,19 @@ extern "C" { #endif /** Texture Sampling, Level-of-Detail, and Filtering */ -qword_t *draw_texture_sampling(qword_t *q, int context, lod_t *lod); +extern qword_t *draw_texture_sampling(qword_t *q, int context, lod_t *lod); /** Mipmap levels 1-3 */ -qword_t *draw_mipmap1(qword_t *q, int context, mipmap_t *mipmap); +extern qword_t *draw_mipmap1(qword_t *q, int context, mipmap_t *mipmap); /** Mipmap levels 4-6 */ -qword_t *draw_mipmap2(qword_t *q, int context, mipmap_t *mipmap); +extern qword_t *draw_mipmap2(qword_t *q, int context, mipmap_t *mipmap); /** Texture Clamping */ -qword_t *draw_texture_wrapping(qword_t *q, int context, texwrap_t *wrap); +extern qword_t *draw_texture_wrapping(qword_t *q, int context, texwrap_t *wrap); /** Alpha Expansion Values */ -qword_t *draw_texture_expand_alpha(qword_t *q, unsigned char zero_value, int expand, unsigned char one_value); +extern qword_t *draw_texture_expand_alpha(qword_t *q, unsigned char zero_value, int expand, unsigned char one_value); #ifdef __cplusplus } diff --git a/ee/draw/include/draw_tests.h b/ee/draw/include/draw_tests.h index 8c48f256248..81b8d5c03cc 100644 --- a/ee/draw/include/draw_tests.h +++ b/ee/draw/include/draw_tests.h @@ -56,16 +56,16 @@ extern "C" { #endif /** Scissoring pixel test area */ -qword_t *draw_scissor_area(qword_t *q, int context, int x0, int x1, int y0, int y1); +extern qword_t *draw_scissor_area(qword_t *q, int context, int x0, int x1, int y0, int y1); /** Pixel Testing */ -qword_t *draw_pixel_test(qword_t *q, int context, atest_t *atest, dtest_t *dtest, ztest_t *ztest); +extern qword_t *draw_pixel_test(qword_t *q, int context, atest_t *atest, dtest_t *dtest, ztest_t *ztest); /** Disable pixel testing defaults */ -qword_t *draw_disable_tests(qword_t *q, int context, zbuffer_t *z); +extern qword_t *draw_disable_tests(qword_t *q, int context, zbuffer_t *z); /** Enable pixel testing defaults */ -qword_t *draw_enable_tests(qword_t *q, int context, zbuffer_t *z); +extern qword_t *draw_enable_tests(qword_t *q, int context, zbuffer_t *z); #ifdef __cplusplus } diff --git a/ee/eedebug/include/ee_debug.h b/ee/eedebug/include/ee_debug.h index 66c0f632873..c861c09866e 100644 --- a/ee/eedebug/include/ee_debug.h +++ b/ee/eedebug/include/ee_debug.h @@ -27,45 +27,45 @@ extern "C" { typedef int (EE_ExceptionHandler)(struct st_EE_RegFrame *); -int ee_dbg_install(int levels); -int ee_dbg_remove(int levels); +extern int ee_dbg_install(int levels); +extern int ee_dbg_remove(int levels); -EE_ExceptionHandler *ee_dbg_get_level1_handler(int cause); -EE_ExceptionHandler *ee_dbg_set_level1_handler(int cause, EE_ExceptionHandler *handler); +extern EE_ExceptionHandler *ee_dbg_get_level1_handler(int cause); +extern EE_ExceptionHandler *ee_dbg_set_level1_handler(int cause, EE_ExceptionHandler *handler); -EE_ExceptionHandler *ee_dbg_get_level2_handler(int cause); -EE_ExceptionHandler *ee_dbg_set_level2_handler(int cause, EE_ExceptionHandler *handler); +extern EE_ExceptionHandler *ee_dbg_get_level2_handler(int cause); +extern EE_ExceptionHandler *ee_dbg_set_level2_handler(int cause, EE_ExceptionHandler *handler); -u32 ee_dbg_get_bpc(void); -void ee_dbg_set_bpc(u32); +extern u32 ee_dbg_get_bpc(void); +extern void ee_dbg_set_bpc(u32); -u32 ee_dbg_get_iab(void); -void ee_dbg_set_iab(u32); +extern u32 ee_dbg_get_iab(void); +extern void ee_dbg_set_iab(u32); -u32 ee_dbg_get_iabm(void); -void ee_dbg_set_iabm(u32); +extern u32 ee_dbg_get_iabm(void); +extern void ee_dbg_set_iabm(u32); -u32 ee_dbg_get_dab(void); -void ee_dbg_set_dab(u32); +extern u32 ee_dbg_get_dab(void); +extern void ee_dbg_set_dab(u32); -u32 ee_dbg_get_dabm(void); -void ee_dbg_set_dabm(u32); +extern u32 ee_dbg_get_dabm(void); +extern void ee_dbg_set_dabm(u32); -u32 ee_dbg_get_dvb(void); -void ee_dbg_set_dvb(u32); +extern u32 ee_dbg_get_dvb(void); +extern void ee_dbg_set_dvb(u32); -u32 ee_dbg_get_dvbm(void); -void ee_dbg_set_dvbm(u32); +extern u32 ee_dbg_get_dvbm(void); +extern void ee_dbg_set_dvbm(u32); -void ee_dbg_set_bpr(u32 addr, u32 mask, u32 opmode_mask); -void ee_dbg_set_bpw(u32 addr, u32 mask, u32 opmode_mask); -void ee_dbg_set_bpv(u32 value, u32 mask, u32 opmode_mask); -void ee_dbg_set_bpx(u32 addr, u32 mask, u32 opmode_mask); +extern void ee_dbg_set_bpr(u32 addr, u32 mask, u32 opmode_mask); +extern void ee_dbg_set_bpw(u32 addr, u32 mask, u32 opmode_mask); +extern void ee_dbg_set_bpv(u32 value, u32 mask, u32 opmode_mask); +extern void ee_dbg_set_bpx(u32 addr, u32 mask, u32 opmode_mask); -void ee_dbg_clr_bps(void); -void ee_dbg_clr_bpda(void); -void ee_dbg_clr_bpdv(void); -void ee_dbg_clr_bpx(void); +extern void ee_dbg_clr_bps(void); +extern void ee_dbg_clr_bpda(void); +extern void ee_dbg_clr_bpdv(void); +extern void ee_dbg_clr_bpx(void); #ifdef __cplusplus } diff --git a/ee/elf-loader/include/elf-loader.h b/ee/elf-loader/include/elf-loader.h index dfba0fd63d9..f3fea4ea340 100644 --- a/ee/elf-loader/include/elf-loader.h +++ b/ee/elf-loader/include/elf-loader.h @@ -21,7 +21,7 @@ extern "C" { #endif // Before call this method be sure that you have previously called sbv_patch_disable_prefix_check(); -int LoadELFFromFile(const char *filename, int argc, char *argv[]); +extern int LoadELFFromFile(const char *filename, int argc, char *argv[]); /** Modify argv[0] when partition info should be kept * @@ -48,7 +48,7 @@ int LoadELFFromFile(const char *filename, int argc, char *argv[]); * partition - pfs:/__common * will be valid usage */ -int LoadELFFromFileWithPartition(const char *filename, const char *partition, int argc, char *argv[]); +extern int LoadELFFromFileWithPartition(const char *filename, const char *partition, int argc, char *argv[]); #ifdef __cplusplus } diff --git a/ee/erl/include/erl.h b/ee/erl/include/erl.h index 110d2d00ba2..5b07cc6cb05 100644 --- a/ee/erl/include/erl.h +++ b/ee/erl/include/erl.h @@ -54,9 +54,9 @@ typedef struct erl_record_t * (*erl_loader_t)(char * erl_id); extern erl_loader_t _init_load_erl; -struct erl_record_t * load_erl_from_mem(u8 * mem, int argc, char ** argv); -struct erl_record_t * load_erl_from_file(const char * fname, int argc, char ** argv); -struct erl_record_t * _init_load_erl_from_file(const char * fname, char * erl_id); +extern struct erl_record_t * load_erl_from_mem(u8 * mem, int argc, char ** argv); +extern struct erl_record_t * load_erl_from_file(const char * fname, int argc, char ** argv); +extern struct erl_record_t * _init_load_erl_from_file(const char * fname, char * erl_id); /* * By default, ERLs are relocated at a dynamic memory address -- a pointer @@ -65,21 +65,21 @@ struct erl_record_t * _init_load_erl_from_file(const char * fname, char * erl_id */ #define ERL_DYN_ADDR 0 -struct erl_record_t * load_erl_from_mem_to_addr(u8 * mem, u32 addr, int argc, char ** argv); -struct erl_record_t * load_erl_from_file_to_addr(const char * fname, u32 addr, int argc, char ** argv); -struct erl_record_t * _init_load_erl_from_file_to_addr(const char * fname, u32 addr, char * erl_id); +extern struct erl_record_t * load_erl_from_mem_to_addr(u8 * mem, u32 addr, int argc, char ** argv); +extern struct erl_record_t * load_erl_from_file_to_addr(const char * fname, u32 addr, int argc, char ** argv); +extern struct erl_record_t * _init_load_erl_from_file_to_addr(const char * fname, u32 addr, char * erl_id); -int unload_erl(struct erl_record_t * erl); +extern int unload_erl(struct erl_record_t * erl); -int erl_add_global_symbol(const char * symbol, u32 address); +extern int erl_add_global_symbol(const char * symbol, u32 address); -struct erl_record_t * find_erl(const char * name); -struct erl_record_t * erl_resolve(u32 address); +extern struct erl_record_t * find_erl(const char * name); +extern struct erl_record_t * erl_resolve(u32 address); -struct symbol_t * erl_find_local_symbol(const char * symbol, struct erl_record_t * erl); -struct symbol_t * erl_find_symbol(const char * symbol); +extern struct symbol_t * erl_find_local_symbol(const char * symbol, struct erl_record_t * erl); +extern struct symbol_t * erl_find_symbol(const char * symbol); -void erl_flush_symbols(struct erl_record_t * erl); +extern void erl_flush_symbols(struct erl_record_t * erl); #ifdef __cplusplus } diff --git a/ee/erl/include/hashtab.h b/ee/erl/include/hashtab.h index 2327c6790ba..f158f83e46b 100644 --- a/ee/erl/include/hashtab.h +++ b/ee/erl/include/hashtab.h @@ -77,7 +77,7 @@ typedef struct htab htab; RETURNS: the new table */ -htab *hcreate(/*_ word logsize _*/); +extern htab *hcreate(/*_ word logsize _*/); /* hdestroy - destroy a hash table @@ -88,7 +88,7 @@ htab *hcreate(/*_ word logsize _*/); RETURNS: nothing */ -void hdestroy(/*_ htab *t _*/); +extern void hdestroy(/*_ htab *t _*/); /* hcount, hkey, hkeyl, hstuff @@ -121,7 +121,7 @@ void hdestroy(/*_ htab *t _*/); TRUE if the item exists, FALSE if it does not. If the item exists, moves the current position to that item. */ -word hfind(/*_ htab *t, ub1 *key, ub4 keyl _*/); +extern word hfind(/*_ htab *t, ub1 *key, ub4 keyl _*/); /* hadd - add a new item to the hash table @@ -134,7 +134,7 @@ word hfind(/*_ htab *t, ub1 *key, ub4 keyl _*/); RETURNS: FALSE if the operation fails (because that key is already there). */ -word hadd(/*_ htab *t, ub1 *key, ub4 keyl, void *stuff _*/); +extern word hadd(/*_ htab *t, ub1 *key, ub4 keyl, void *stuff _*/); /* hdel - delete the item at the current position @@ -153,7 +153,7 @@ word hadd(/*_ htab *t, ub1 *key, ub4 keyl, void *stuff _*/); hdel(tab); } */ -word hdel(/* htab *t */); +extern word hdel(/* htab *t */); /* hfirst - move position to the first item in the table @@ -163,7 +163,7 @@ word hdel(/* htab *t */); FALSE if there is no current item (meaning the table is empty) NOTE: */ -word hfirst(/*_ htab *t _*/); +extern word hfirst(/*_ htab *t _*/); /* hnext - move position to the next item in the table @@ -193,7 +193,7 @@ word hfirst(/*_ htab *t _*/); NOTE: This is private to hashtab; do not use it externally. */ -word hnbucket(/*_ htab *t _*/); +extern word hnbucket(/*_ htab *t _*/); /* hstat - print statistics about the hash table @@ -212,7 +212,7 @@ word hnbucket(/*_ htab *t _*/); have n items. That is, .3678 0, .3678 1, .1839 2, ... Also expect "existing" to be about 2. */ -void hstat(/*_ htab *t _*/); +extern void hstat(/*_ htab *t _*/); #ifdef __cplusplus } diff --git a/ee/erl/include/lookupa.h b/ee/erl/include/lookupa.h index 119cf04ef4f..12e313ab88a 100644 --- a/ee/erl/include/lookupa.h +++ b/ee/erl/include/lookupa.h @@ -22,8 +22,8 @@ extern "C" { #define hashsize(n) ((ub4)1<<(n)) #define hashmask(n) (hashsize(n)-1) -ub4 lookup(/*_ ub1 *k, ub4 length, ub4 level _*/); -void checksum(/*_ ub1 *k, ub4 length, ub4 *state _*/); +extern ub4 lookup(/*_ ub1 *k, ub4 length, ub4 level _*/); +extern void checksum(/*_ ub1 *k, ub4 length, ub4 *state _*/); #ifdef __cplusplus } diff --git a/ee/erl/include/recycle.h b/ee/erl/include/recycle.h index c3977a33119..1eb9c75faea 100644 --- a/ee/erl/include/recycle.h +++ b/ee/erl/include/recycle.h @@ -44,16 +44,16 @@ struct reroot typedef struct reroot reroot; /* make a new recycling root */ -reroot *remkroot(/*_ size_t mysize _*/); +extern reroot *remkroot(/*_ size_t mysize _*/); /* free a recycling root and all the items it has made */ -void refree(/*_ struct reroot *r _*/); +extern void refree(/*_ struct reroot *r _*/); /* get a new (cleared) item from the root */ #define renew(r) ((r)->numleft ? \ (((char *)((r)->list+1))+((r)->numleft-=(r)->size)) : renewx(r)) -char *renewx(/*_ struct reroot *r _*/); +extern char *renewx(/*_ struct reroot *r _*/); /* delete an item; let the root recycle it */ /* void redel(/o_ struct reroot *r, struct recycle *item _o/); */ @@ -64,7 +64,7 @@ char *renewx(/*_ struct reroot *r _*/); /* malloc, but exit program if no joy */ /* use plain free() to free memory allocated by remalloc() */ -char *remalloc(/*_ size_t len _*/); +extern char *remalloc(/*_ size_t len _*/); #ifdef __cplusplus } diff --git a/ee/font/include/font.h b/ee/font/include/font.h index 5d3debd2272..720d0b7df23 100644 --- a/ee/font/include/font.h +++ b/ee/font/include/font.h @@ -74,16 +74,16 @@ extern "C" { /** Loads a FontX2 type font with set characteristics * Use "rom0:KROM" as the path to load the PS2's internal FontX2 font */ -int fontx_load(const char *path, fontx_t* fontx, int type, int wmargin, int hmargin, int bold); +extern int fontx_load(const char *path, fontx_t* fontx, int type, int wmargin, int hmargin, int bold); /** Frees memory if a font is loaded */ -void fontx_unload(fontx_t *fontx); +extern void fontx_unload(fontx_t *fontx); /** Prints an ascii/JISX201 formatted string */ -qword_t *fontx_print_ascii(qword_t *q, int context, const unsigned char *str, int alignment, const vertex_t *v0, color_t *c0, fontx_t *fontx); +extern qword_t *fontx_print_ascii(qword_t *q, int context, const unsigned char *str, int alignment, const vertex_t *v0, color_t *c0, fontx_t *fontx); /** Prints a SJIS formatted string */ -qword_t *fontx_print_sjis(qword_t *q, int context, const unsigned char *str, int alignment, const vertex_t *v0, color_t *c0, fontx_t *ascii, fontx_t *kanji); +extern qword_t *fontx_print_sjis(qword_t *q, int context, const unsigned char *str, int alignment, const vertex_t *v0, color_t *c0, fontx_t *ascii, fontx_t *kanji); // FontStudio type fonts @@ -91,21 +91,21 @@ qword_t *fontx_print_sjis(qword_t *q, int context, const unsigned char *str, int // Make sure to setup the texture buffer with the font texture prior to printing /** Loads the FontStudio ini file that contains the font texture's characteristics */ -fsfont_t *fontstudio_init(int height); +extern fsfont_t *fontstudio_init(int height); -void fontstudio_free(fsfont_t *font); +extern void fontstudio_free(fsfont_t *font); /** Parses a font's ini for the font. The content of ini is no longer required afterwards and can be discarded. */ -int fontstudio_parse_ini(fsfont_t *font, char *ini, float tex_width, float tex_height); +extern int fontstudio_parse_ini(fsfont_t *font, char *ini, float tex_width, float tex_height); /** Loads an ini file into memory and returns pointer to it */ -char *fontstudio_load_ini(const char *path); +extern char *fontstudio_load_ini(const char *path); /** Unloads a parsed font's ini file. */ -void fontstudio_unload_ini(fsfont_t *font); +extern void fontstudio_unload_ini(fsfont_t *font); /** Prints a unicode formatted string (UTF+8) */ -qword_t *fontstudio_print_string(qword_t *q, int context, const unsigned char *string, int alignment, const vertex_t *v0, color_t *c0, fsfont_t *font); +extern qword_t *fontstudio_print_string(qword_t *q, int context, const unsigned char *string, int alignment, const vertex_t *v0, color_t *c0, fsfont_t *font); #ifdef __cplusplus } diff --git a/ee/graph/include/graph.h b/ee/graph/include/graph.h index 939490d6da7..740634aaf62 100644 --- a/ee/graph/include/graph.h +++ b/ee/graph/include/graph.h @@ -99,58 +99,58 @@ extern "C" { #endif /** Initializes a default NTSC/PAL mode with default settings. */ -int graph_initialize(int fbp, int width, int height, int psm, int x, int y); +extern int graph_initialize(int fbp, int width, int height, int psm, int x, int y); /** Retrieves the PS2's region for automatic mode selection. */ -int graph_get_region(void); +extern int graph_get_region(void); /** Returns an aspect ratio calculated from system setting, width, and height */ -float graph_aspect_ratio(void); +extern float graph_aspect_ratio(void); /** Sets a default output method. */ -void graph_enable_output(void); +extern void graph_enable_output(void); /** Turns off the read circuits. */ -void graph_disable_output(void); +extern void graph_disable_output(void); /** Sets the graphics mode. */ -int graph_set_mode(int interlace, int mode, int ffmd, int flicker_filter); +extern int graph_set_mode(int interlace, int mode, int ffmd, int flicker_filter); /** Sets the screen dimensions for the read circuits. */ -int graph_set_screen(int x, int y, int width, int height); +extern int graph_set_screen(int x, int y, int width, int height); /** Sets the framebuffer attributes for the read circuits with filter. */ -void graph_set_framebuffer_filtered(int fbp, int width, int psm, int x, int y); +extern void graph_set_framebuffer_filtered(int fbp, int width, int psm, int x, int y); /** Sets the framebuffer attributes for the read circuits. */ -void graph_set_framebuffer(int context, int fbp, int width, int psm, int x, int y); +extern void graph_set_framebuffer(int context, int fbp, int width, int psm, int x, int y); /** Sets the background color for merge circuit. */ -void graph_set_bgcolor(unsigned char r, unsigned char g, unsigned char b); +extern void graph_set_bgcolor(unsigned char r, unsigned char g, unsigned char b); /** Sets the read circuits and merge cicuit. */ -void graph_set_output(int rc1, int rc2, int alpha_select, int alpha_output, int blend_method, unsigned char alpha); +extern void graph_set_output(int rc1, int rc2, int alpha_select, int alpha_output, int blend_method, unsigned char alpha); /** Add a vsync interrupt handler */ -int graph_add_vsync_handler(int (*vsync_callback)()); +extern int graph_add_vsync_handler(int (*vsync_callback)()); /** Remove a vsync interrupt handler */ -void graph_remove_vsync_handler(int callback_id); +extern void graph_remove_vsync_handler(int callback_id); /** Starts a horizontal sync event and waits */ -void graph_wait_hsync(void); +extern void graph_wait_hsync(void); /** Starts a vertical sync event and waits. */ -void graph_wait_vsync(void); +extern void graph_wait_vsync(void); /** Checks if a vertical sync event is currently generated. */ -int graph_check_vsync(void); +extern int graph_check_vsync(void); /** Starts a vertical sync event and returns immediately. */ -void graph_start_vsync(void); +extern void graph_start_vsync(void); /** Shut down the graphics library and hardware. */ -int graph_shutdown(void); +extern int graph_shutdown(void); ///****************USE AT OWN RISK****************/// /// Sets PLL sync generator control register. /// diff --git a/ee/graph/include/graph_config.h b/ee/graph/include/graph_config.h index d3445bce58b..af2fa912c94 100644 --- a/ee/graph/include/graph_config.h +++ b/ee/graph/include/graph_config.h @@ -13,19 +13,19 @@ extern "C" { /** Creates a string from the current mode. * The string format is: mode:int:ffmd:filter:x:y: */ -int graph_make_config(int mode, int interlace, int ffmd, int x, int y, int flicker_filter, char *config); +extern int graph_make_config(int mode, int interlace, int ffmd, int x, int y, int flicker_filter, char *config); /** Gets the string made from the current mode. */ -int graph_get_config(char *config); +extern int graph_get_config(char *config); /** Sets the mode from the configuration string. */ -int graph_set_config(char *config); +extern int graph_set_config(char *config); /** Reads the configuration string from a file and sets it. */ -int graph_load_config(char *filename); +extern int graph_load_config(char *filename); /** Writes the current mode information into a config file as a string. */ -int graph_save_config(char *filename); +extern int graph_save_config(char *filename); #ifdef __cplusplus } diff --git a/ee/graph/include/graph_vram.h b/ee/graph/include/graph_vram.h index 936efb26c91..c7f48d80e23 100644 --- a/ee/graph/include/graph_vram.h +++ b/ee/graph/include/graph_vram.h @@ -20,16 +20,16 @@ extern "C" { #endif /** Allocates vram and returns vram base pointer */ -int graph_vram_allocate(int width, int height, int psm, int alignment); +extern int graph_vram_allocate(int width, int height, int psm, int alignment); /** Frees in FIFO order... */ -void graph_vram_free(int address); +extern void graph_vram_free(int address); /** Clears the vram status */ -void graph_vram_clear(void); +extern void graph_vram_clear(void); /** Calculate the size in vram of a texture or buffer */ -int graph_vram_size(int width, int height, int psm, int alignment); +extern int graph_vram_size(int width, int height, int psm, int alignment); #ifdef __cplusplus } diff --git a/ee/input/include/input.h b/ee/input/include/input.h index 228d5b68cb8..9ddfc2a4c55 100644 --- a/ee/input/include/input.h +++ b/ee/input/include/input.h @@ -64,53 +64,53 @@ extern "C" { #endif /** Open and initialize a pad */ -pad_t *pad_open(unsigned int port, unsigned int slot, unsigned int mode, unsigned int lock); +extern pad_t *pad_open(unsigned int port, unsigned int slot, unsigned int mode, unsigned int lock); /** Get the pad's current button status */ static inline void pad_get_buttons(pad_t *pad) { - padRead(pad->port,pad->slot,pad->buttons); + padRead(pad->port,pad->slot,pad->buttons); } /** Close the pad */ -void pad_close(pad_t *pad); +extern void pad_close(pad_t *pad); /** Wait until the pad is ready to accept commands */ -void pad_wait(pad_t *pad); +extern void pad_wait(pad_t *pad); #ifdef DEBUG /** Get the pad's current state and print it */ -void pad_print_state(pad_t *pad); +extern void pad_print_state(pad_t *pad); /** Print the pad's supported modes */ -void pad_print_supported_modes(pad_t *pad); +extern void pad_print_supported_modes(pad_t *pad); #endif /** Set the pad's mode and mode lock */ -void pad_set_mode(pad_t *pad, int mode, int lock); +extern void pad_set_mode(pad_t *pad, int mode, int lock); /** Set the pad's pressure sensitivity */ -void pad_set_sensitivity(pad_t *pad, int enable); +extern void pad_set_sensitivity(pad_t *pad, int enable); /** Init actuators */ -void pad_init_actuators(pad_t *pad); +extern void pad_init_actuators(pad_t *pad); /** Set actuators */ -void pad_set_actuators(pad_t *pad, int small, unsigned char large); +extern void pad_set_actuators(pad_t *pad, int small, unsigned char large); /** Get the pad's state */ -int pad_get_state(pad_t *pad); +extern int pad_get_state(pad_t *pad); /** Get number of modes supported by pad */ -int pad_get_num_modes(pad_t *pad); +extern int pad_get_num_modes(pad_t *pad); /** Check if a type is supported by pad */ -int pad_has_type(pad_t *pad, int type); +extern int pad_has_type(pad_t *pad, int type); /** Get the pad's type */ -int pad_get_type(pad_t *pad); +extern int pad_get_type(pad_t *pad); /** Get the pad's current mode */ -int pad_get_mode(pad_t *pad); +extern int pad_get_mode(pad_t *pad); #ifdef __cplusplus }; diff --git a/ee/iopreboot/include/iopcontrol_special.h b/ee/iopreboot/include/iopcontrol_special.h index a401afec106..f5a08317abb 100644 --- a/ee/iopreboot/include/iopcontrol_special.h +++ b/ee/iopreboot/include/iopcontrol_special.h @@ -25,7 +25,7 @@ extern "C" { * @param size Size of UDNL module in bytes. * @return 1 for success or 0 for failure. */ -int SifIopRebootBufferEncrypted(const void *udnl, int size); +extern int SifIopRebootBufferEncrypted(const void *udnl, int size); /** Resets IOP * Reboots the IOP with an IOPRP image. If the image contains an IOPBTCONF file, * the IOPBTCONF file will be automatically split off into its own image @@ -33,7 +33,7 @@ int SifIopRebootBufferEncrypted(const void *udnl, int size); * @param size Size of the IOPRP image in bytes. * @return 1 for success or 0 for failure. */ -int SifIopRebootBuffer(const void *ioprp, int size); +extern int SifIopRebootBuffer(const void *ioprp, int size); #ifdef __cplusplus } diff --git a/ee/kernel/include/fileio.h b/ee/kernel/include/fileio.h index a7ba7de8d22..ab22c35ffde 100644 --- a/ee/kernel/include/fileio.h +++ b/ee/kernel/include/fileio.h @@ -36,28 +36,28 @@ extern "C" { #endif -int fioInit(void); -void fioExit(void); -int fioOpen(const char *fname, int mode); -int fioClose(int fd); -int fioRead(int fd, void *buff, int buff_size); -int fioWrite(int fd, const void *buff, int buff_size); -int fioLseek(int fd, int offset, int whence); -int fioMkdir(const char *dirname); -int fioPutc(int fd, int c); -int fioGetc(int fd); -int fioGets(int fd, char *buff, int n); -void fioSetBlockMode(int blocking); -int fioSync(int mode, int *retVal); -int fioIoctl(int fd, int request, void *data); -int fioDopen(const char *name); -int fioDclose(int fd); -int fioDread(int fd, io_dirent_t *buf); // Warning! (*) -int fioGetstat(const char *name, io_stat_t *buf); // Warning! (*) -int fioChstat(const char *name, io_stat_t *buf, unsigned int cbit); -int fioRemove(const char *name); // Warning! (**) -int fioFormat(const char *name); -int fioRmdir(const char *dirname); +extern int fioInit(void); +extern void fioExit(void); +extern int fioOpen(const char *fname, int mode); +extern int fioClose(int fd); +extern int fioRead(int fd, void *buff, int buff_size); +extern int fioWrite(int fd, const void *buff, int buff_size); +extern int fioLseek(int fd, int offset, int whence); +extern int fioMkdir(const char *dirname); +extern int fioPutc(int fd, int c); +extern int fioGetc(int fd); +extern int fioGets(int fd, char *buff, int n); +extern void fioSetBlockMode(int blocking); +extern int fioSync(int mode, int *retVal); +extern int fioIoctl(int fd, int request, void *data); +extern int fioDopen(const char *name); +extern int fioDclose(int fd); +extern int fioDread(int fd, io_dirent_t *buf); // Warning! (*) +extern int fioGetstat(const char *name, io_stat_t *buf); // Warning! (*) +extern int fioChstat(const char *name, io_stat_t *buf, unsigned int cbit); +extern int fioRemove(const char *name); // Warning! (**) +extern int fioFormat(const char *name); +extern int fioRmdir(const char *dirname); /* * Function is unstable; does not suspend interrupts prior to performing DMA transfers on the IOP side. ** Function is broken; falls through to the next case (mkdir) upon completion. diff --git a/ee/kernel/include/iopcontrol.h b/ee/kernel/include/iopcontrol.h index 3d4ea45c0b6..4d4dc31aa4f 100644 --- a/ee/kernel/include/iopcontrol.h +++ b/ee/kernel/include/iopcontrol.h @@ -25,21 +25,21 @@ extern "C" { * @param arg a const character pointer for path to module that will be loaded afterwards or an empty string. NULL must not be specified. * @return 1 for success or 0 for failure. */ -int SifIopReboot(const char *arg); +extern int SifIopReboot(const char *arg); /** Resets IOP * @param arg a const character pointer for path to module that will be loaded afterwards or a blank. NULL is not officially supported, but is supported for backward-compatibility with old homebrew projects. * @param mode Bitmask for optional settings. 0x80000000 for verbose messages and 0x100 for magicgate. * @return 1 for success or 0 for failure. */ -int SifIopReset(const char *arg, int mode); +extern int SifIopReset(const char *arg, int mode); /** * @return 1 for SIF initialized or 0 for not initialized. */ -int SifIopIsAlive(void); +extern int SifIopIsAlive(void); /** * @return 1 for bootup complete or 0 for incomplete. */ -int SifIopSync(void); +extern int SifIopSync(void); #ifdef __cplusplus } diff --git a/ee/kernel/include/iopheap.h b/ee/kernel/include/iopheap.h index f9caff6e581..bfc0bde51d8 100644 --- a/ee/kernel/include/iopheap.h +++ b/ee/kernel/include/iopheap.h @@ -20,13 +20,13 @@ extern "C" { #endif -int SifInitIopHeap(void); -void SifExitIopHeap(void); +extern int SifInitIopHeap(void); +extern void SifExitIopHeap(void); -void *SifAllocIopHeap(int size); -int SifFreeIopHeap(void *addr); +extern void *SifAllocIopHeap(int size); +extern int SifFreeIopHeap(void *addr); -int SifLoadIopHeap(const char *path, void *addr); +extern int SifLoadIopHeap(const char *path, void *addr); #ifdef __cplusplus } diff --git a/ee/kernel/include/kernel.h b/ee/kernel/include/kernel.h index 30d05586c3a..cec940f4b51 100644 --- a/ee/kernel/include/kernel.h +++ b/ee/kernel/include/kernel.h @@ -52,9 +52,9 @@ #define ALIGNED(x) __attribute__((aligned((x)))) // GP functions -void *ChangeGP(void *gp); -void SetGP(void *gp); -void *GetGP(void); +extern void *ChangeGP(void *gp); +extern void SetGP(void *gp); +extern void *GetGP(void); extern void *_gp; #define SetModuleGP() ChangeGP(&_gp) @@ -318,236 +318,236 @@ extern "C" { #endif /* Initialization/deinitialization routines. */ -void _InitSys(void); // Run by crt0 +extern void _InitSys(void); // Run by crt0 -void TerminateLibrary(void); // Run by crt0 +extern void TerminateLibrary(void); // Run by crt0 /* Thread update functions */ -int InitThread(void); // Run by _InitSys +extern int InitThread(void); // Run by _InitSys -s32 iWakeupThread(s32 thread_id); -s32 iRotateThreadReadyQueue(s32 priority); -s32 iSuspendThread(s32 thread_id); +extern s32 iWakeupThread(s32 thread_id); +extern s32 iRotateThreadReadyQueue(s32 priority); +extern s32 iSuspendThread(s32 thread_id); /* TLB update functions */ -void InitTLBFunctions(void); // Run by _InitSys +extern void InitTLBFunctions(void); // Run by _InitSys -void InitTLB(void); -void Exit(s32 exit_code) __attribute__((noreturn)); -s32 ExecPS2(void *entry, void *gp, int num_args, char *args[]); -void LoadExecPS2(const char *filename, s32 num_args, char *args[]) __attribute__((noreturn)); -void ExecOSD(int num_args, char *args[]) __attribute__((noreturn)); +extern void InitTLB(void); +extern void Exit(s32 exit_code) __attribute__((noreturn)); +extern s32 ExecPS2(void *entry, void *gp, int num_args, char *args[]); +extern void LoadExecPS2(const char *filename, s32 num_args, char *args[]) __attribute__((noreturn)); +extern void ExecOSD(int num_args, char *args[]) __attribute__((noreturn)); /* Alarm update functions */ -void InitAlarm(void); // Run by _InitSys +extern void InitAlarm(void); // Run by _InitSys /* libosd update functions */ -void InitExecPS2(void); // ExecPS2 patch only. Run by _InitSys, Exit, LoadExecPS2, ExecPS2 and ExecOSD -void InitOsd(void); // ExecPS2 + System Configuration patches. Please refer to the comments within libosd_full.c +extern void InitExecPS2(void); // ExecPS2 patch only. Run by _InitSys, Exit, LoadExecPS2, ExecPS2 and ExecOSD +extern void InitOsd(void); // ExecPS2 + System Configuration patches. Please refer to the comments within libosd_full.c -int PatchIsNeeded(void); // Indicates whether the patch is required. +extern int PatchIsNeeded(void); // Indicates whether the patch is required. // Debug (print) update functions: -void InitDebug(void); +extern void InitDebug(void); /* Glue routines. */ -int DIntr(void); -int EIntr(void); +extern int DIntr(void); +extern int EIntr(void); -int EnableIntc(int intc); -int DisableIntc(int intc); -int EnableDmac(int dmac); -int DisableDmac(int dmac); +extern int EnableIntc(int intc); +extern int DisableIntc(int intc); +extern int EnableDmac(int dmac); +extern int DisableDmac(int dmac); -int iEnableIntc(int intc); -int iDisableIntc(int intc); -int iEnableDmac(int dmac); -int iDisableDmac(int dmac); +extern int iEnableIntc(int intc); +extern int iDisableIntc(int intc); +extern int iEnableDmac(int dmac); +extern int iDisableDmac(int dmac); -void SyncDCache(void *start, void *end); -void iSyncDCache(void *start, void *end); -void InvalidDCache(void *start, void *end); -void iInvalidDCache(void *start, void *end); +extern void SyncDCache(void *start, void *end); +extern void iSyncDCache(void *start, void *end); +extern void InvalidDCache(void *start, void *end); +extern void iInvalidDCache(void *start, void *end); /* System call prototypes */ -void ResetEE(u32 init_bitfield); -void SetGsCrt(s16 interlace, s16 pal_ntsc, s16 field); -void KExit(s32 exit_code) __attribute__((noreturn)); -void _LoadExecPS2(const char *filename, s32 num_args, char *args[]) __attribute__((noreturn)); -s32 _ExecPS2(void *entry, void *gp, int num_args, char *args[]); -void RFU009(u32 arg0, u32 arg1); -s32 AddSbusIntcHandler(s32 cause, void (*handler)(int call)); -s32 RemoveSbusIntcHandler(s32 cause); -s32 Interrupt2Iop(s32 cause); -void SetVTLBRefillHandler(s32 handler_num, void *handler_func); -void SetVCommonHandler(s32 handler_num, void *handler_func); -void SetVInterruptHandler(s32 handler_num, void *handler_func); -s32 AddIntcHandler(s32 cause, s32 (*handler_func)(s32 cause), s32 next); -s32 AddIntcHandler2(s32 cause, s32 (*handler_func)(s32 cause, void *arg, void *addr), s32 next, void *arg); -s32 RemoveIntcHandler(s32 cause, s32 handler_id); -s32 AddDmacHandler(s32 channel, s32 (*handler)(s32 channel), s32 next); -s32 AddDmacHandler2(s32 channel, s32 (*handler)(s32 channel, void *arg, void *addr), s32 next, void *arg); -s32 RemoveDmacHandler(s32 channel, s32 handler_id); -s32 _EnableIntc(s32 cause); -s32 _DisableIntc(s32 cause); -s32 _EnableDmac(s32 channel); -s32 _DisableDmac(s32 channel); +extern void ResetEE(u32 init_bitfield); +extern void SetGsCrt(s16 interlace, s16 pal_ntsc, s16 field); +extern void KExit(s32 exit_code) __attribute__((noreturn)); +extern void _LoadExecPS2(const char *filename, s32 num_args, char *args[]) __attribute__((noreturn)); +extern s32 _ExecPS2(void *entry, void *gp, int num_args, char *args[]); +extern void RFU009(u32 arg0, u32 arg1); +extern s32 AddSbusIntcHandler(s32 cause, void (*handler)(int call)); +extern s32 RemoveSbusIntcHandler(s32 cause); +extern s32 Interrupt2Iop(s32 cause); +extern void SetVTLBRefillHandler(s32 handler_num, void *handler_func); +extern void SetVCommonHandler(s32 handler_num, void *handler_func); +extern void SetVInterruptHandler(s32 handler_num, void *handler_func); +extern s32 AddIntcHandler(s32 cause, s32 (*handler_func)(s32 cause), s32 next); +extern s32 AddIntcHandler2(s32 cause, s32 (*handler_func)(s32 cause, void *arg, void *addr), s32 next, void *arg); +extern s32 RemoveIntcHandler(s32 cause, s32 handler_id); +extern s32 AddDmacHandler(s32 channel, s32 (*handler)(s32 channel), s32 next); +extern s32 AddDmacHandler2(s32 channel, s32 (*handler)(s32 channel, void *arg, void *addr), s32 next, void *arg); +extern s32 RemoveDmacHandler(s32 channel, s32 handler_id); +extern s32 _EnableIntc(s32 cause); +extern s32 _DisableIntc(s32 cause); +extern s32 _EnableDmac(s32 channel); +extern s32 _DisableDmac(s32 channel); // Alarm value is in H-SYNC ticks. -s32 SetAlarm(u16 time, void (*callback)(s32 alarm_id, u16 time, void *common), void *common); -s32 _SetAlarm(u16 time, void (*callback)(s32 alarm_id, u16 time, void *common), void *common); -s32 ReleaseAlarm(s32 alarm_id); -s32 _ReleaseAlarm(s32 alarm_id); - -s32 _iEnableIntc(s32 cause); -s32 _iDisableIntc(s32 cause); -s32 _iEnableDmac(s32 channel); -s32 _iDisableDmac(s32 channel); - -s32 iSetAlarm(u16 time, void (*callback)(s32 alarm_id, u16 time, void *common), void *common); -s32 _iSetAlarm(u16 time, void (*callback)(s32 alarm_id, u16 time, void *common), void *common); -s32 iReleaseAlarm(s32 alarm_id); -s32 _iReleaseAlarm(s32 alarm_id); - -s32 CreateThread(ee_thread_t *thread); -s32 DeleteThread(s32 thread_id); -s32 StartThread(s32 thread_id, void *args); -void ExitThread(void); -void ExitDeleteThread(void); -s32 TerminateThread(s32 thread_id); -s32 iTerminateThread(s32 thread_id); -// void DisableDispatchThread(void); // not supported -// void EnableDispatchThread(void); // not supported -s32 ChangeThreadPriority(s32 thread_id, s32 priority); -s32 iChangeThreadPriority(s32 thread_id, s32 priority); -s32 RotateThreadReadyQueue(s32 priority); -s32 _iRotateThreadReadyQueue(s32 priority); -s32 ReleaseWaitThread(s32 thread_id); -s32 iReleaseWaitThread(s32 thread_id); -s32 GetThreadId(void); -s32 _iGetThreadId(void); // This is actually GetThreadId(), used for a hack by SCE to work around the iWakeupThread design flaw. -s32 ReferThreadStatus(s32 thread_id, ee_thread_status_t *info); -s32 iReferThreadStatus(s32 thread_id, ee_thread_status_t *info); -s32 SleepThread(void); -s32 WakeupThread(s32 thread_id); -s32 _iWakeupThread(s32 thread_id); -s32 CancelWakeupThread(s32 thread_id); -s32 iCancelWakeupThread(s32 thread_id); -s32 SuspendThread(s32 thread_id); -s32 _iSuspendThread(s32 thread_id); -s32 ResumeThread(s32 thread_id); -s32 iResumeThread(s32 thread_id); - -u8 RFU059(void); - -void *SetupThread(void *gp, void *stack, s32 stack_size, void *args, void *root_func); -void SetupHeap(void *heap_start, s32 heap_size); -void *EndOfHeap(void); - -s32 CreateSema(ee_sema_t *sema); -s32 DeleteSema(s32 sema_id); -s32 SignalSema(s32 sema_id); -s32 iSignalSema(s32 sema_id); -s32 WaitSema(s32 sema_id); -s32 PollSema(s32 sema_id); -s32 iPollSema(s32 sema_id); -s32 ReferSemaStatus(s32 sema_id, ee_sema_t *sema); -s32 iReferSemaStatus(s32 sema_id, ee_sema_t *sema); -s32 iDeleteSema(s32 sema_id); -void SetOsdConfigParam(void *addr); -void GetOsdConfigParam(void *addr); -void GetGsHParam(void *addr1, void *addr2, void *addr3); -s32 GetGsVParam(void); -void SetGsHParam(void *addr1, void *addr2, void *addr3, void *addr4); -void SetGsVParam(s32 arg1); +extern s32 SetAlarm(u16 time, void (*callback)(s32 alarm_id, u16 time, void *common), void *common); +extern s32 _SetAlarm(u16 time, void (*callback)(s32 alarm_id, u16 time, void *common), void *common); +extern s32 ReleaseAlarm(s32 alarm_id); +extern s32 _ReleaseAlarm(s32 alarm_id); + +extern s32 _iEnableIntc(s32 cause); +extern s32 _iDisableIntc(s32 cause); +extern s32 _iEnableDmac(s32 channel); +extern s32 _iDisableDmac(s32 channel); + +extern s32 iSetAlarm(u16 time, void (*callback)(s32 alarm_id, u16 time, void *common), void *common); +extern s32 _iSetAlarm(u16 time, void (*callback)(s32 alarm_id, u16 time, void *common), void *common); +extern s32 iReleaseAlarm(s32 alarm_id); +extern s32 _iReleaseAlarm(s32 alarm_id); + +extern s32 CreateThread(ee_thread_t *thread); +extern s32 DeleteThread(s32 thread_id); +extern s32 StartThread(s32 thread_id, void *args); +extern void ExitThread(void); +extern void ExitDeleteThread(void); +extern s32 TerminateThread(s32 thread_id); +extern s32 iTerminateThread(s32 thread_id); +// extern void DisableDispatchThread(void); // not supported +// extern void EnableDispatchThread(void); // not supported +extern s32 ChangeThreadPriority(s32 thread_id, s32 priority); +extern s32 iChangeThreadPriority(s32 thread_id, s32 priority); +extern s32 RotateThreadReadyQueue(s32 priority); +extern s32 _iRotateThreadReadyQueue(s32 priority); +extern s32 ReleaseWaitThread(s32 thread_id); +extern s32 iReleaseWaitThread(s32 thread_id); +extern s32 GetThreadId(void); +extern s32 _iGetThreadId(void); // This is actually GetThreadId(), used for a hack by SCE to work around the iWakeupThread design flaw. +extern s32 ReferThreadStatus(s32 thread_id, ee_thread_status_t *info); +extern s32 iReferThreadStatus(s32 thread_id, ee_thread_status_t *info); +extern s32 SleepThread(void); +extern s32 WakeupThread(s32 thread_id); +extern s32 _iWakeupThread(s32 thread_id); +extern s32 CancelWakeupThread(s32 thread_id); +extern s32 iCancelWakeupThread(s32 thread_id); +extern s32 SuspendThread(s32 thread_id); +extern s32 _iSuspendThread(s32 thread_id); +extern s32 ResumeThread(s32 thread_id); +extern s32 iResumeThread(s32 thread_id); + +extern u8 RFU059(void); + +extern void *SetupThread(void *gp, void *stack, s32 stack_size, void *args, void *root_func); +extern void SetupHeap(void *heap_start, s32 heap_size); +extern void *EndOfHeap(void); + +extern s32 CreateSema(ee_sema_t *sema); +extern s32 DeleteSema(s32 sema_id); +extern s32 SignalSema(s32 sema_id); +extern s32 iSignalSema(s32 sema_id); +extern s32 WaitSema(s32 sema_id); +extern s32 PollSema(s32 sema_id); +extern s32 iPollSema(s32 sema_id); +extern s32 ReferSemaStatus(s32 sema_id, ee_sema_t *sema); +extern s32 iReferSemaStatus(s32 sema_id, ee_sema_t *sema); +extern s32 iDeleteSema(s32 sema_id); +extern void SetOsdConfigParam(void *addr); +extern void GetOsdConfigParam(void *addr); +extern void GetGsHParam(void *addr1, void *addr2, void *addr3); +extern s32 GetGsVParam(void); +extern void SetGsHParam(void *addr1, void *addr2, void *addr3, void *addr4); +extern void SetGsVParam(s32 arg1); // TLB functions are only available if InitTLBFunctions() is run (Normally run by crt0). -int PutTLBEntry(unsigned int PageMask, unsigned int EntryHi, unsigned int EntryLo0, unsigned int EntryLo1); -int iPutTLBEntry(unsigned int PageMask, unsigned int EntryHi, unsigned int EntryLo0, unsigned int EntryLo1); -int _SetTLBEntry(unsigned int index, unsigned int PageMask, unsigned int EntryHi, unsigned int EntryLo0, unsigned int EntryLo1); -int iSetTLBEntry(unsigned int index, unsigned int PageMask, unsigned int EntryHi, unsigned int EntryLo0, unsigned int EntryLo1); -int GetTLBEntry(unsigned int index, unsigned int *PageMask, unsigned int *EntryHi, unsigned int *EntryLo0, unsigned int *EntryLo1); -int iGetTLBEntry(unsigned int index, unsigned int *PageMask, unsigned int *EntryHi, unsigned int *EntryLo0, unsigned int *EntryLo1); -int ProbeTLBEntry(unsigned int EntryHi, unsigned int *PageMask, unsigned int *EntryLo0, unsigned int *EntryLo1); -int iProbeTLBEntry(unsigned int EntryHi, unsigned int *PageMask, unsigned int *EntryLo0, unsigned int *EntryLo1); -int ExpandScratchPad(unsigned int page); - -void EnableIntcHandler(u32 cause); -void iEnableIntcHandler(u32 cause); -void DisableIntcHandler(u32 cause); -void iDisableIntcHandler(u32 cause); -void EnableDmacHandler(u32 channel); -void iEnableDmacHandler(u32 channel); -void DisableDmacHandler(u32 channel); -void iDisableDmacHandler(u32 channel); -void KSeg0(s32 arg1); -s32 EnableCache(s32 cache); -s32 DisableCache(s32 cache); -u32 GetCop0(s32 reg_id); -void FlushCache(s32 operation); -u32 CpuConfig(u32 config); -u32 iGetCop0(s32 reg_id); -void iFlushCache(s32 operation); -u32 iCpuConfig(u32 config); -void SetCPUTimerHandler(void (*handler)(void)); -void SetCPUTimer(s32 compval); +extern int PutTLBEntry(unsigned int PageMask, unsigned int EntryHi, unsigned int EntryLo0, unsigned int EntryLo1); +extern int iPutTLBEntry(unsigned int PageMask, unsigned int EntryHi, unsigned int EntryLo0, unsigned int EntryLo1); +extern int _SetTLBEntry(unsigned int index, unsigned int PageMask, unsigned int EntryHi, unsigned int EntryLo0, unsigned int EntryLo1); +extern int iSetTLBEntry(unsigned int index, unsigned int PageMask, unsigned int EntryHi, unsigned int EntryLo0, unsigned int EntryLo1); +extern int GetTLBEntry(unsigned int index, unsigned int *PageMask, unsigned int *EntryHi, unsigned int *EntryLo0, unsigned int *EntryLo1); +extern int iGetTLBEntry(unsigned int index, unsigned int *PageMask, unsigned int *EntryHi, unsigned int *EntryLo0, unsigned int *EntryLo1); +extern int ProbeTLBEntry(unsigned int EntryHi, unsigned int *PageMask, unsigned int *EntryLo0, unsigned int *EntryLo1); +extern int iProbeTLBEntry(unsigned int EntryHi, unsigned int *PageMask, unsigned int *EntryLo0, unsigned int *EntryLo1); +extern int ExpandScratchPad(unsigned int page); + +extern void EnableIntcHandler(u32 cause); +extern void iEnableIntcHandler(u32 cause); +extern void DisableIntcHandler(u32 cause); +extern void iDisableIntcHandler(u32 cause); +extern void EnableDmacHandler(u32 channel); +extern void iEnableDmacHandler(u32 channel); +extern void DisableDmacHandler(u32 channel); +extern void iDisableDmacHandler(u32 channel); +extern void KSeg0(s32 arg1); +extern s32 EnableCache(s32 cache); +extern s32 DisableCache(s32 cache); +extern u32 GetCop0(s32 reg_id); +extern void FlushCache(s32 operation); +extern u32 CpuConfig(u32 config); +extern u32 iGetCop0(s32 reg_id); +extern void iFlushCache(s32 operation); +extern u32 iCpuConfig(u32 config); +extern void SetCPUTimerHandler(void (*handler)(void)); +extern void SetCPUTimer(s32 compval); // These two are not available in the unpatched Protokernel (Unpatched SCPH-10000 and SCPH-15000 kernels). -void SetOsdConfigParam2(void *config, s32 size, s32 offset); -void GetOsdConfigParam2(void *config, s32 size, s32 offset); +extern void SetOsdConfigParam2(void *config, s32 size, s32 offset); +extern void GetOsdConfigParam2(void *config, s32 size, s32 offset); -u64 GsGetIMR(void); -u64 iGsGetIMR(void); -u64 GsPutIMR(u64 imr); -u64 iGsPutIMR(u64 imr); -void SetPgifHandler(void *handler); -void SetVSyncFlag(u32 *, u64 *); -void SetSyscall(s32 syscall_num, void *handler); -void _print(const char *fmt, ...); // Disabled by default, must call InitDebug() to enable +extern u64 GsGetIMR(void); +extern u64 iGsGetIMR(void); +extern u64 GsPutIMR(u64 imr); +extern u64 iGsPutIMR(u64 imr); +extern void SetPgifHandler(void *handler); +extern void SetVSyncFlag(u32 *, u64 *); +extern void SetSyscall(s32 syscall_num, void *handler); +extern void _print(const char *fmt, ...); // Disabled by default, must call InitDebug() to enable -void SifStopDma(void); // Disables SIF0 (IOP -> EE). +extern void SifStopDma(void); // Disables SIF0 (IOP -> EE). -s32 SifDmaStat(u32 id); -s32 iSifDmaStat(u32 id); -u32 SifSetDma(SifDmaTransfer_t *sdd, s32 len); -u32 iSifSetDma(SifDmaTransfer_t *sdd, s32 len); +extern s32 SifDmaStat(u32 id); +extern s32 iSifDmaStat(u32 id); +extern u32 SifSetDma(SifDmaTransfer_t *sdd, s32 len); +extern u32 iSifSetDma(SifDmaTransfer_t *sdd, s32 len); // Enables SIF0 (IOP -> EE). Sets channel 5 CHCR to 0x184 (CHAIN, TIE and STR). -void SifSetDChain(void); -void iSifSetDChain(void); +extern void SifSetDChain(void); +extern void iSifSetDChain(void); // Sets/gets SIF register values (Refer to sifdma.h for a register list). -int SifSetReg(u32 register_num, int register_value); -int SifGetReg(u32 register_num); +extern int SifSetReg(u32 register_num, int register_value); +extern int SifGetReg(u32 register_num); -void _ExecOSD(int num_args, char *args[]) __attribute__((noreturn)); -s32 Deci2Call(s32, u32 *); -void PSMode(void); -s32 MachineType(void); -s32 GetMemorySize(void); +extern void _ExecOSD(int num_args, char *args[]) __attribute__((noreturn)); +extern s32 Deci2Call(s32, u32 *); +extern void PSMode(void); +extern s32 MachineType(void); +extern s32 GetMemorySize(void); // Internal function for getting board-specific offsets, only present in later kernels (ROMVER > 20010608). -void _GetGsDxDyOffset(int mode, int *dx, int *dy, int *dw, int *dh); +extern void _GetGsDxDyOffset(int mode, int *dx, int *dy, int *dw, int *dh); // Internal function for reinitializing the TLB, only present in later kernels. Please use InitTLB() instead to initialize the TLB with all kernels. -int _InitTLB(void); +extern int _InitTLB(void); /* (PSX only) Sets the memory size. 0 = 64MB mode, 1 = 32MB mode. The mode is only binding when either _InitTLB() or the PSX ExecPS2() syscall is called. The stack pointer must remain in range of usable memory, or a TLB exception will occur. */ -int SetMemoryMode(int mode); // Arbitrarily named. +extern int SetMemoryMode(int mode); // Arbitrarily named. -void _SyncDCache(void *start, void *end); -void _InvalidDCache(void *start, void *end); +extern void _SyncDCache(void *start, void *end); +extern void _InvalidDCache(void *start, void *end); -void *GetSyscallHandler(int syscall_no); -void *GetExceptionHandler(int except_no); -void *GetInterruptHandler(int intr_no); +extern void *GetSyscallHandler(int syscall_no); +extern void *GetExceptionHandler(int except_no); +extern void *GetInterruptHandler(int intr_no); /* Helper functions for kernel patching */ -int kCopy(void *dest, const void *src, int size); -int kCopyBytes(void *dest, const void *src, int size); -int Copy(void *dest, const void *src, int size); -void setup(int syscall_num, void *handler); // alias of "SetSyscall" -void *GetEntryAddress(int syscall); +extern int kCopy(void *dest, const void *src, int size); +extern int kCopyBytes(void *dest, const void *src, int size); +extern int Copy(void *dest, const void *src, int size); +extern void setup(int syscall_num, void *handler); // alias of "SetSyscall" +extern void *GetEntryAddress(int syscall); // Helpers marcos for no-patch versions // Useful to build a special version of libkernel that does not contain any runtime patches (useful for loaders/resident programs). diff --git a/ee/kernel/include/loadfile.h b/ee/kernel/include/loadfile.h index 8a9821632df..87ba5df8a23 100644 --- a/ee/kernel/include/loadfile.h +++ b/ee/kernel/include/loadfile.h @@ -39,13 +39,13 @@ extern "C" { * * Initializes the LOADFILE API and binds to the remote LOADFILE RPC server. */ -int SifLoadFileInit(void); +extern int SifLoadFileInit(void); /** Reset the LOADFILE library. * @ingroup loadfile * * Deinitializes the LOADFILE library in preparation of an IOP reset. */ -void SifLoadFileExit(void); +extern void SifLoadFileExit(void); /** Load and execute an IRX module. * @ingroup loadfile @@ -69,7 +69,7 @@ void SifLoadFileExit(void); * * @see SifExecModuleFile */ -int SifLoadModule(const char *path, int arg_len, const char *args); +extern int SifLoadModule(const char *path, int arg_len, const char *args); /** Load and execute and IRX module, and retrieve the module's load status. * @ingroup loadfile * @@ -87,7 +87,7 @@ int SifLoadModule(const char *path, int arg_len, const char *args); * * @see SifLoadModule */ -int SifLoadStartModule(const char *path, int arg_len, const char *args, int *mod_res); +extern int SifLoadStartModule(const char *path, int arg_len, const char *args, int *mod_res); /** Load and execute an IRX module encrypted with MagicGate. * @ingroup loadfile @@ -103,7 +103,7 @@ int SifLoadStartModule(const char *path, int arg_len, const char *args, int *mod * * @see SifLoadModule */ -int SifLoadModuleEncrypted(const char *path, int arg_len, const char *args); +extern int SifLoadModuleEncrypted(const char *path, int arg_len, const char *args); /** Load and execute an IRX module from a buffer in IOP RAM. * @ingroup loadfile @@ -123,7 +123,7 @@ int SifLoadModuleEncrypted(const char *path, int arg_len, const char *args); * * @see SifLoadModule, SifExecModuleBuffer */ -int SifLoadModuleBuffer(void *ptr, int arg_len, const char *args); +extern int SifLoadModuleBuffer(void *ptr, int arg_len, const char *args); /** Load and execute an IRX module from a buffer in IOP RAM, and retrieve the module's load status. * @ingroup loadfile * @@ -144,12 +144,12 @@ int SifLoadModuleBuffer(void *ptr, int arg_len, const char *args); * * @see SifLoadModule, SifExecModuleBuffer */ -int SifLoadStartModuleBuffer(void *ptr, int arg_len, const char *args, int *mod_res); +extern int SifLoadStartModuleBuffer(void *ptr, int arg_len, const char *args, int *mod_res); -int SifStopModule(int id, int arg_len, const char *args, int *mod_res); -int SifUnloadModule(int id); -int SifSearchModuleByName(const char *name); -int SifSearchModuleByAddress(const void *ptr); +extern int SifStopModule(int id, int arg_len, const char *args, int *mod_res); +extern int SifUnloadModule(int id); +extern int SifSearchModuleByName(const char *name); +extern int SifSearchModuleByAddress(const void *ptr); /** Load the specified section of an ELF executable into EE RAM. * @ingroup loadfile @@ -167,7 +167,7 @@ int SifSearchModuleByAddress(const void *ptr); * * @warning Don't ever use this function, it does not work as intended. */ -int SifLoadElfPart(const char *path, const char *secname, t_ExecData *data); +extern int SifLoadElfPart(const char *path, const char *secname, t_ExecData *data); /** Load an ELF executable into EE RAM. * @ingroup loadfile * @@ -196,7 +196,7 @@ int SifLoadElf(const char *path, t_ExecData *data); * * @see SifLoadElf */ -int SifLoadElfEncrypted(const char *path, t_ExecData *data); +extern int SifLoadElfEncrypted(const char *path, t_ExecData *data); /** Write a value to an address within the IOP's memory space. * @ingroup loadfile @@ -220,7 +220,7 @@ int SifLoadElfEncrypted(const char *path, t_ExecData *data); * * @see SifIopGetVal */ -int SifIopSetVal(u32 iop_addr, int val, int type); +extern int SifIopSetVal(u32 iop_addr, int val, int type); /** Read a value from an address within the IOP's memory space. * @ingroup loadfile * @@ -241,7 +241,7 @@ int SifIopSetVal(u32 iop_addr, int val, int type); * read the IOP's hardware registers directly so there is little use for this function. * @see SifIopSetVal */ -int SifIopGetVal(u32 iop_addr, void *val, int type); +extern int SifIopGetVal(u32 iop_addr, void *val, int type); /** Transfer an IRX module from EE RAM to IOP RAM and execute it. * @ingroup loadfile @@ -261,7 +261,7 @@ int SifIopGetVal(u32 iop_addr, void *val, int type); * * @see SifLoadModule, SifLoadModuleBuffer */ -int SifExecModuleBuffer(void *ptr, u32 size, u32 arg_len, const char *args, int *mod_res); +extern int SifExecModuleBuffer(void *ptr, u32 size, u32 arg_len, const char *args, int *mod_res); /** Read an IRX module from a file into IOP RAM and execute it. * @ingroup loadfile * @@ -279,7 +279,7 @@ int SifExecModuleBuffer(void *ptr, u32 size, u32 arg_len, const char *args, int * * @see SifLoadModule, SifLoadModuleBuffer */ -int SifExecModuleFile(const char *path, u32 arg_len, const char *args, int *mod_res); +extern int SifExecModuleFile(const char *path, u32 arg_len, const char *args, int *mod_res); /** Low-level function for loading and executing an IRX module. @@ -299,7 +299,7 @@ int SifExecModuleFile(const char *path, u32 arg_len, const char *args, int *mod_ * * @see SifLoadModule, SifLoadModuleBuffer, SifLoadModuleEncrypted */ -int _SifLoadModule(const char *path, int arg_len, const char *args, +extern int _SifLoadModule(const char *path, int arg_len, const char *args, int *modres, int fno, int dontwait); #ifdef __cplusplus diff --git a/ee/kernel/include/osd_config.h b/ee/kernel/include/osd_config.h index 53d98379e10..b7fcbd1c150 100644 --- a/ee/kernel/include/osd_config.h +++ b/ee/kernel/include/osd_config.h @@ -128,96 +128,96 @@ extern "C" { /** get the language the ps2 is currently set to * @return Language value (See OSD_LANGUAGES above) */ -int configGetLanguage(void); -int configGetLanguageWithIODriver(_io_driver *driver); +extern int configGetLanguage(void); +extern int configGetLanguageWithIODriver(_io_driver *driver); /** sets the default language of the ps2 * @param language Language value (See OSD_LANGUAGES above) */ -void configSetLanguage(int language); -void configSetLanguageWithIODriver(int language, _io_driver *driver); +extern void configSetLanguage(int language); +extern void configSetLanguageWithIODriver(int language, _io_driver *driver); /** get the tv screen type the ps2 is setup for * @return 0 = 4:3; 1 = fullscreen; 2 = 16:9 */ -int configGetTvScreenType(void); -int configGetTvScreenTypeWithIODriver(_io_driver *driver); +extern int configGetTvScreenType(void); +extern int configGetTvScreenTypeWithIODriver(_io_driver *driver); /** set the tv screen type * @param screenType 0 = 4:3; 1 = fullscreen; 2 = 16:9 */ -void configSetTvScreenType(int screenType); -void configSetTvScreenTypeWithIODriver(int screenType, _io_driver *driver); +extern void configSetTvScreenType(int screenType); +extern void configSetTvScreenTypeWithIODriver(int screenType, _io_driver *driver); /** gets the date display format * @return 0 = yyyy/mm/dd; 1 = mm/dd/yyyy; 2 = dd/mm/yyyy */ -int configGetDateFormat(void); -int configGetDateFormatWithIODriver(_io_driver *driver); +extern int configGetDateFormat(void); +extern int configGetDateFormatWithIODriver(_io_driver *driver); /** sets the date display format * @param dateFormat 0 = yyyy/mm/dd; 1 = mm/dd/yyyy; 2 = dd/mm/yyyy */ -void configSetDateFormat(int dateFormat); -void configSetDateFormatWithIODriver(int dateFormat, _io_driver *driver); +extern void configSetDateFormat(int dateFormat); +extern void configSetDateFormatWithIODriver(int dateFormat, _io_driver *driver); /** gets the time display format * (whether 24hour time or not) * @return 0 = 24hour; 1 = 12hour */ -int configGetTimeFormat(void); -int configGetTimeFormatWithIODriver(_io_driver *driver); +extern int configGetTimeFormat(void); +extern int configGetTimeFormatWithIODriver(_io_driver *driver); /** sets the time display format * (whether 24hour time or not) * @param timeFormat 0 = 24hour; 1 = 12hour */ -void configSetTimeFormat(int timeFormat); -void configSetTimeFormatWithIODriver(int timeFormat, _io_driver *driver); +extern void configSetTimeFormat(int timeFormat); +extern void configSetTimeFormatWithIODriver(int timeFormat, _io_driver *driver); /** get timezone * @return offset in minutes from GMT */ -int configGetTimezone(void); -int configGetTimezoneWithIODriver(_io_driver *driver); +extern int configGetTimezone(void); +extern int configGetTimezoneWithIODriver(_io_driver *driver); /** set timezone * @param offset offset in minutes from GMT */ -void configSetTimezone(int offset); -void configSetTimezoneWithIODriver(int timezoneOffset, _io_driver *driver, void (*finishedCallback)(void)); +extern void configSetTimezone(int offset); +extern void configSetTimezoneWithIODriver(int timezoneOffset, _io_driver *driver, void (*finishedCallback)(void)); /** checks whether the spdif is enabled or not * @return 1 = on; 0 = off */ -int configIsSpdifEnabled(void); -int configIsSpdifEnabledWithIODriver(_io_driver *driver); +extern int configIsSpdifEnabled(void); +extern int configIsSpdifEnabledWithIODriver(_io_driver *driver); /** sets whether the spdif is enabled or not * @param enabled 1 = on; 0 = off */ -void configSetSpdifEnabled(int enabled); -void configSetSpdifEnabledWithIODriver(int enabled, _io_driver *driver); +extern void configSetSpdifEnabled(int enabled); +extern void configSetSpdifEnabledWithIODriver(int enabled, _io_driver *driver); /** checks whether daylight saving is currently set * @return 1 = on; 0 = off */ -int configIsDaylightSavingEnabled(void); -int configIsDaylightSavingEnabledWithIODriver(_io_driver *driver); +extern int configIsDaylightSavingEnabled(void); +extern int configIsDaylightSavingEnabledWithIODriver(_io_driver *driver); /** sets daylight saving * @param enabled 1 = on; 0 = off */ -void configSetDaylightSavingEnabled(int enabled); -void configSetDaylightSavingEnabledWithIODriver(int daylightSaving, _io_driver *driver, void (*finishedCallback)(void)); +extern void configSetDaylightSavingEnabled(int enabled); +extern void configSetDaylightSavingEnabledWithIODriver(int daylightSaving, _io_driver *driver, void (*finishedCallback)(void)); #ifndef OSD_CONFIG_NO_LIBCDVD /** converts the time returned from the ps2's clock into GMT time * (ps2 clock is in JST time) */ -void configConvertToGmtTime(sceCdCLOCK *time); -void configConvertToLocalTimeWithIODriver(sceCdCLOCK *time, _io_driver *driver); +extern void configConvertToGmtTime(sceCdCLOCK *time); +extern void configConvertToLocalTimeWithIODriver(sceCdCLOCK *time, _io_driver *driver); #endif // Internal functions. @@ -226,7 +226,7 @@ void configConvertToLocalTimeWithIODriver(sceCdCLOCK *time, _io_driver *driver); * @param config unsigned int config value from GetOsdConfigParam() syscall * @return 1 if early jap model; 0 if not */ -int IsEarlyJap(ConfigParam config); +extern int IsEarlyJap(ConfigParam config); #ifdef __cplusplus } diff --git a/ee/kernel/include/rom0_info.h b/ee/kernel/include/rom0_info.h index 4e7f48aa439..b02ccc6730e 100644 --- a/ee/kernel/include/rom0_info.h +++ b/ee/kernel/include/rom0_info.h @@ -32,15 +32,15 @@ typedef struct { * * @return 1 if DESR-XXXX machine; 0 if not */ -int IsDESRMachine(void); -int IsDESRMachineWithIODriver(_io_driver *driver); +extern int IsDESRMachine(void); +extern int IsDESRMachineWithIODriver(_io_driver *driver); /** check whether the PlayStation 2 is actually a TOOL DTL-T10000(H) * * @return 1 if DTL-T10000(H); 0 if not */ -int IsT10K(void); -int IsT10KWithIODriver(_io_driver *driver); +extern int IsT10K(void); +extern int IsT10KWithIODriver(_io_driver *driver); /** gets the romname from the current ps2 * 14 chars - doesnt set a null terminator @@ -48,8 +48,8 @@ int IsT10KWithIODriver(_io_driver *driver); * @param romname buffer to hold romname (14 chars long) * @return pointer to buffer containing romname */ -char *GetRomName(char *romname); -char *GetRomNameWithIODriver(char *romname, _io_driver *driver); +extern char *GetRomName(char *romname); +extern char *GetRomNameWithIODriver(char *romname, _io_driver *driver); #ifdef __cplusplus } diff --git a/ee/kernel/include/sifcmd.h b/ee/kernel/include/sifcmd.h index 4ba2cf16d6c..4011dfa46ce 100644 --- a/ee/kernel/include/sifcmd.h +++ b/ee/kernel/include/sifcmd.h @@ -84,18 +84,18 @@ typedef struct _iop_reset_pkt extern "C" { #endif -unsigned int SifSendCmd(int cmd, void *packet, int packet_size, void *src_extra, +extern unsigned int SifSendCmd(int cmd, void *packet, int packet_size, void *src_extra, void *dest_extra, int size_extra); -unsigned int iSifSendCmd(int cmd, void *packet, int packet_size, void *src_extra, +extern unsigned int iSifSendCmd(int cmd, void *packet, int packet_size, void *src_extra, void *dest_extra, int size_extra); -void SifAddCmdHandler(int pos, SifCmdHandler_t handler, void *harg); -void SifRemoveCmdHandler(int pos); -void SifInitCmd(void); -void SifExitCmd(void); -SifCmdHandlerData_t *SifSetCmdBuffer(SifCmdHandlerData_t *db, int size); -int SifGetSreg(int index); - -void SifWriteBackDCache(void *ptr, int size); // EE only +extern void SifAddCmdHandler(int pos, SifCmdHandler_t handler, void *harg); +extern void SifRemoveCmdHandler(int pos); +extern void SifInitCmd(void); +extern void SifExitCmd(void); +extern SifCmdHandlerData_t *SifSetCmdBuffer(SifCmdHandlerData_t *db, int size); +extern int SifGetSreg(int index); + +extern void SifWriteBackDCache(void *ptr, int size); // EE only // Send mode bits /** Called within an interrupt context */ diff --git a/ee/kernel/include/sifdma.h b/ee/kernel/include/sifdma.h index b64dc9b035a..3841c891454 100644 --- a/ee/kernel/include/sifdma.h +++ b/ee/kernel/include/sifdma.h @@ -61,8 +61,8 @@ typedef struct t_SifDmaTransfer extern "C" { #endif -u32 SifSetDma(SifDmaTransfer_t *sdd, s32 len); -s32 SifDmaStat(u32 id); +extern u32 SifSetDma(SifDmaTransfer_t *sdd, s32 len); +extern s32 SifDmaStat(u32 id); #ifdef __cplusplus } diff --git a/ee/kernel/include/sifrpc.h b/ee/kernel/include/sifrpc.h index f4ee2dcdf6e..4ffc166cd7e 100644 --- a/ee/kernel/include/sifrpc.h +++ b/ee/kernel/include/sifrpc.h @@ -165,37 +165,37 @@ typedef struct t_SifRpcDataQueue extern "C" { #endif -void SifInitRpc(int mode); -void SifExitRpc(void); +extern void SifInitRpc(int mode); +extern void SifExitRpc(void); /* SIF RPC client API */ -int SifBindRpc(SifRpcClientData_t *client, int rpc_number, int mode); -int SifCallRpc(SifRpcClientData_t *client, int rpc_number, int mode, +extern int SifBindRpc(SifRpcClientData_t *client, int rpc_number, int mode); +extern int SifCallRpc(SifRpcClientData_t *client, int rpc_number, int mode, void *send, int ssize, void *receive, int rsize, SifRpcEndFunc_t end_function, void *end_param); -int SifRpcGetOtherData(SifRpcReceiveData_t *rd, void *src, void *dest, +extern int SifRpcGetOtherData(SifRpcReceiveData_t *rd, void *src, void *dest, int size, int mode); -int SifCheckStatRpc(SifRpcClientData_t *cd); +extern int SifCheckStatRpc(SifRpcClientData_t *cd); /* SIF RPC server API */ -SifRpcDataQueue_t * +extern SifRpcDataQueue_t * SifSetRpcQueue(SifRpcDataQueue_t *q, int thread_id); -SifRpcDataQueue_t * +extern SifRpcDataQueue_t * SifRemoveRpcQueue(SifRpcDataQueue_t *qd); -SifRpcServerData_t * +extern SifRpcServerData_t * SifRegisterRpc(SifRpcServerData_t *srv, int sid, SifRpcFunc_t func, void *buff, SifRpcFunc_t cfunc, void *cbuff, SifRpcDataQueue_t *qd); -SifRpcServerData_t * +extern SifRpcServerData_t * SifRemoveRpc(SifRpcServerData_t *sd, SifRpcDataQueue_t *queue); -SifRpcServerData_t * +extern SifRpcServerData_t * SifGetNextRequest(SifRpcDataQueue_t *qd); -void SifExecRequest(SifRpcServerData_t *srv); -void SifRpcLoop(SifRpcDataQueue_t *q); +extern void SifExecRequest(SifRpcServerData_t *srv); +extern void SifRpcLoop(SifRpcDataQueue_t *q); #ifdef __cplusplus } diff --git a/ee/kernel/include/sio.h b/ee/kernel/include/sio.h index 0c7aadb9d86..2572cd28a64 100644 --- a/ee/kernel/include/sio.h +++ b/ee/kernel/include/sio.h @@ -93,30 +93,30 @@ extern "C" { * You can pass 0 for all of the lcr_* params to get the standard 8N1 setting (8 data bits, no parity checking, 1 stop bit). * Note: Unlike the BIOS sio_init() routine, we always base the baud rate on the CPU clock. */ -void sio_init(u32 baudrate, u8 lcr_ueps, u8 lcr_upen, u8 lcr_usbl, u8 lcr_umode); +extern void sio_init(u32 baudrate, u8 lcr_ueps, u8 lcr_upen, u8 lcr_usbl, u8 lcr_umode); -int sio_putc(int c); -int sio_getc(void); +extern int sio_putc(int c); +extern int sio_getc(void); /** Same as sio_getc, but blocking. * Note that getc should be blocking by default. Ho well. */ -int sio_getc_block(void); +extern int sio_getc_block(void); /** Not really much to do in the way of error-handling. sio_putc() already * checks to see if there's room in the TX FIFO, and my cable doesn't support * hardware flow control. */ -size_t sio_write(void *buf, size_t size); +extern size_t sio_write(void *buf, size_t size); /** This will read from the serial port until size characters have been read or EOF (RX FIFO is empty). */ -size_t sio_read(void *buf, size_t size); +extern size_t sio_read(void *buf, size_t size); -int sio_puts(const char *str); -int sio_putsn(const char *str); // no newline for this one +extern int sio_puts(const char *str); +extern int sio_putsn(const char *str); // no newline for this one /** Will block until it recieves \n or \r. */ -char *sio_gets(char *str); +extern char *sio_gets(char *str); /** Flushes the input buffer. */ -void sio_flush(void); +extern void sio_flush(void); #ifdef __cplusplus } diff --git a/ee/kernel/src/osdsrc/src/ExecPS2.h b/ee/kernel/src/osdsrc/src/ExecPS2.h index d043115cb4e..f441f92cbaa 100644 --- a/ee/kernel/src/osdsrc/src/ExecPS2.h +++ b/ee/kernel/src/osdsrc/src/ExecPS2.h @@ -7,4 +7,4 @@ # Review ps2sdk README & LICENSE files for further details. */ -void *ExecPS2Patch(void *EntryPoint, void *gp, int argc, char *argv[]); +extern void *ExecPS2Patch(void *EntryPoint, void *gp, int argc, char *argv[]); diff --git a/ee/kernel/src/osdsrc/src/osd.h b/ee/kernel/src/osdsrc/src/osd.h index b8b56082289..6b1e3b3d169 100644 --- a/ee/kernel/src/osdsrc/src/osd.h +++ b/ee/kernel/src/osdsrc/src/osd.h @@ -13,8 +13,8 @@ typedef union u8 data[40]; } SystemConfiguration_t; -void InitSystemConfig(SystemConfiguration_t *SysConf, int SysConfLen); -void SetOsdConfigParam(ConfigParam *config); -void GetOsdConfigParam(ConfigParam *config); -void SetOsdConfigParam2(void *config, int size, int offset); -int GetOsdConfigParam2(void *config, int size, int offset); +extern void InitSystemConfig(SystemConfiguration_t *SysConf, int SysConfLen); +extern void SetOsdConfigParam(ConfigParam *config); +extern void GetOsdConfigParam(ConfigParam *config); +extern void SetOsdConfigParam2(void *config, int size, int offset); +extern int GetOsdConfigParam2(void *config, int size, int offset); diff --git a/ee/kernel/src/srcfile/src/internal.h b/ee/kernel/src/srcfile/src/internal.h index 8b1ebef1598..bf93ab08cb9 100644 --- a/ee/kernel/src/srcfile/src/internal.h +++ b/ee/kernel/src/srcfile/src/internal.h @@ -7,6 +7,6 @@ # Review ps2sdk README & LICENSE files for further details. */ -void Intc12Handler(void); -void InvokeUserModeCallback(void *dispatcher, void *callback, int id, u32 target, void *common); -void ResumeIntrDispatch(void); +extern void Intc12Handler(void); +extern void InvokeUserModeCallback(void *dispatcher, void *callback, int id, u32 target, void *common); +extern void ResumeIntrDispatch(void); diff --git a/ee/libcglue/include/arpa/inet.h b/ee/libcglue/include/arpa/inet.h index 966bc3bad9a..f64ad57cf23 100644 --- a/ee/libcglue/include/arpa/inet.h +++ b/ee/libcglue/include/arpa/inet.h @@ -22,10 +22,10 @@ #endif __BEGIN_DECLS -u32 libcglue_inet_addr(const char *cp); -char *libcglue_inet_ntoa(const ip4_addr_t *addr); -char *libcglue_inet_ntoa_r(const ip4_addr_t *addr, char *buf, int buflen); -int libcglue_inet_aton(const char *cp, ip4_addr_t *addr); +extern u32 libcglue_inet_addr(const char *cp); +extern char *libcglue_inet_ntoa(const ip4_addr_t *addr); +extern char *libcglue_inet_ntoa_r(const ip4_addr_t *addr, char *buf, int buflen); +extern int libcglue_inet_aton(const char *cp, ip4_addr_t *addr); __END_DECLS #endif diff --git a/ee/libcglue/include/netdb.h b/ee/libcglue/include/netdb.h index 29a535cc76d..e8e482e5b7a 100644 --- a/ee/libcglue/include/netdb.h +++ b/ee/libcglue/include/netdb.h @@ -15,11 +15,11 @@ #include __BEGIN_DECLS -struct hostent *gethostbyaddr(const void *addr, int len, int type); -struct hostent *gethostbyname(const char *name); -int gethostbyname_r(const char *name, struct hostent *ret, char *buf, size_t buflen, struct hostent **result, int *h_errnop); -void freeaddrinfo(struct addrinfo *ai); -int getaddrinfo(const char *nodename, const char *servname, const struct addrinfo *hints, struct addrinfo **res); +extern struct hostent *gethostbyaddr(const void *addr, int len, int type); +extern struct hostent *gethostbyname(const char *name); +extern int gethostbyname_r(const char *name, struct hostent *ret, char *buf, size_t buflen, struct hostent **result, int *h_errnop); +extern void freeaddrinfo(struct addrinfo *ai); +extern int getaddrinfo(const char *nodename, const char *servname, const struct addrinfo *hints, struct addrinfo **res); __END_DECLS #endif diff --git a/ee/libcglue/include/ps2sdkapi.h b/ee/libcglue/include/ps2sdkapi.h index 87d42ffa04c..d805e21ed9e 100644 --- a/ee/libcglue/include/ps2sdkapi.h +++ b/ee/libcglue/include/ps2sdkapi.h @@ -154,7 +154,7 @@ extern _libcglue_fdman_inet_ops_t *_libcglue_fdman_inet_ops; /* Functions from cwd.c */ extern char __cwd[MAXNAMLEN + 1]; -int __path_absolute(const char *in, char *out, int len); +extern int __path_absolute(const char *in, char *out, int len); #define PS2_CLOCKS_PER_SEC kBUSCLKBY256 // 576.000 #define PS2_CLOCKS_PER_MSEC (PS2_CLOCKS_PER_SEC / 1000) // 576 @@ -180,16 +180,16 @@ extern void _libcglue_rtc_update(); // The newlib port does not support 64bit // this should have been defined in unistd.h typedef int64_t off64_t; -off64_t lseek64(int fd, off64_t offset, int whence); +extern off64_t lseek64(int fd, off64_t offset, int whence); // Functions to be used related to timezone extern void _libcglue_timezone_update(); -void ps2sdk_setTimezone(int timezone); -void ps2sdk_setDaylightSaving(int daylightSaving); +extern void ps2sdk_setTimezone(int timezone); +extern void ps2sdk_setDaylightSaving(int daylightSaving); -_libcglue_fdman_fd_info_t *libcglue_get_fd_info(int fd); -int __libcglue_init_stdio(_libcglue_fdman_fd_info_t *info, int fd); +extern _libcglue_fdman_fd_info_t *libcglue_get_fd_info(int fd); +extern int __libcglue_init_stdio(_libcglue_fdman_fd_info_t *info, int fd); /* The fd we provide to final user aren't actually the same than IOP's fd * so this function allow you to get actual IOP's fd from public fd diff --git a/ee/libcglue/include/sjis.h b/ee/libcglue/include/sjis.h index 186f1d77838..3011cc2cd98 100644 --- a/ee/libcglue/include/sjis.h +++ b/ee/libcglue/include/sjis.h @@ -25,7 +25,7 @@ extern "C" { * @param ascii_buff source ascii string buffer * @return length of ascii string copied */ -int strcpy_sjis(short* sjis_buff, const char* ascii_buff); +extern int strcpy_sjis(short* sjis_buff, const char* ascii_buff); /** copies sjis string to ascii string * @@ -33,7 +33,7 @@ int strcpy_sjis(short* sjis_buff, const char* ascii_buff); * @param sjis_buff source sjis string buffer * @return length of sjis string copied */ -int strcpy_ascii(char* ascii_buff, const short* sjis_buff); +extern int strcpy_ascii(char* ascii_buff, const short* sjis_buff); #ifdef __cplusplus } diff --git a/ee/libcglue/include/sys/socket.h b/ee/libcglue/include/sys/socket.h index d951c2d616e..76fd3b451fa 100644 --- a/ee/libcglue/include/sys/socket.h +++ b/ee/libcglue/include/sys/socket.h @@ -663,37 +663,37 @@ __END_DECLS #ifndef _KERNEL __BEGIN_DECLS -int accept(int, struct sockaddr * __restrict, socklen_t * __restrict); +extern int accept(int, struct sockaddr * __restrict, socklen_t * __restrict); #if 0 -int accept4(int, struct sockaddr * __restrict, socklen_t * __restrict, int); +extern int accept4(int, struct sockaddr * __restrict, socklen_t * __restrict, int); #endif -int bind(int, const struct sockaddr *, socklen_t); -int connect(int, const struct sockaddr *, socklen_t); -int getpeername(int, struct sockaddr * __restrict, socklen_t * __restrict); -int getsockname(int, struct sockaddr * __restrict, socklen_t * __restrict); -int getsockopt(int, int, int, void *__restrict, socklen_t * __restrict); +extern int bind(int, const struct sockaddr *, socklen_t); +extern int connect(int, const struct sockaddr *, socklen_t); +extern int getpeername(int, struct sockaddr * __restrict, socklen_t * __restrict); +extern int getsockname(int, struct sockaddr * __restrict, socklen_t * __restrict); +extern int getsockopt(int, int, int, void *__restrict, socklen_t * __restrict); #if 0 -int getsockopt2(int, int, int, void *__restrict, socklen_t * __restrict); +extern int getsockopt2(int, int, int, void *__restrict, socklen_t * __restrict); #endif -int listen(int, int); +extern int listen(int, int); #if 0 -int paccept(int, struct sockaddr * __restrict, socklen_t * __restrict, +extern int paccept(int, struct sockaddr * __restrict, socklen_t * __restrict, const sigset_t * __restrict, int); #endif -ssize_t recv(int, void *, size_t, int); -ssize_t recvfrom(int, void *__restrict, size_t, int, - struct sockaddr * __restrict, socklen_t * __restrict); -ssize_t recvmsg(int, struct msghdr *, int); -ssize_t send(int, const void *, size_t, int); -ssize_t sendto(int, const void *, - size_t, int, const struct sockaddr *, socklen_t); -ssize_t sendmsg(int, const struct msghdr *, int); -int setsockopt(int, int, int, const void *, socklen_t); -int shutdown(int, int); +extern ssize_t recv(int, void *, size_t, int); +extern ssize_t recvfrom(int, void *__restrict, size_t, int, + struct sockaddr * __restrict, socklen_t * __restrict); +extern ssize_t recvmsg(int, struct msghdr *, int); +extern ssize_t send(int, const void *, size_t, int); +extern ssize_t sendto(int, const void *, + size_t, int, const struct sockaddr *, socklen_t); +extern ssize_t sendmsg(int, const struct msghdr *, int); +extern int setsockopt(int, int, int, const void *, socklen_t); +extern int shutdown(int, int); #if 0 -int sockatmark(int); +extern int sockatmark(int); #endif -int socket(int, int, int) +extern int socket(int, int, int) #if 0 #if !defined(__LIBC12_SOURCE__) && !defined(_STANDALONE) __RENAME(__socket30) @@ -701,22 +701,22 @@ __RENAME(__socket30) #endif ; #if 0 -int socketpair(int, int, int, int *); +extern int socketpair(int, int, int, int *); #endif #if 0 #if defined(_NETBSD_SOURCE) -int sendmmsg(int, struct mmsghdr *, unsigned int, unsigned int); +extern int sendmmsg(int, struct mmsghdr *, unsigned int, unsigned int); struct timespec; -int recvmmsg(int, struct mmsghdr *, unsigned int, unsigned int, +extern int recvmmsg(int, struct mmsghdr *, unsigned int, unsigned int, struct timespec *); #endif #endif #if 1 -int libcglue_ps2ip_setconfig(t_ip_info *ip_info); -int libcglue_ps2ip_getconfig(char *netif_name, t_ip_info *ip_info); -void libcglue_dns_setserver(u8 numdns, ip_addr_t *dnsserver); -const ip_addr_t *libcglue_dns_getserver(u8 numdns); +extern int libcglue_ps2ip_setconfig(t_ip_info *ip_info); +extern int libcglue_ps2ip_getconfig(char *netif_name, t_ip_info *ip_info); +extern void libcglue_dns_setserver(u8 numdns, ip_addr_t *dnsserver); +extern const ip_addr_t *libcglue_dns_getserver(u8 numdns); #endif __END_DECLS diff --git a/ee/libcglue/samples/regress/testsuite.h b/ee/libcglue/samples/regress/testsuite.h index f1ce80910cc..63f7970c7f5 100644 --- a/ee/libcglue/samples/regress/testsuite.h +++ b/ee/libcglue/samples/regress/testsuite.h @@ -20,8 +20,8 @@ typedef struct test_suite test_t *tests; } test_suite; -void init_testsuite(test_suite *p); -int add_test(test_suite *p, const char *name, testfunc_t func, void *arg); -int run_testsuite(test_suite *p); +extern void init_testsuite(test_suite *p); +extern int add_test(test_suite *p, const char *name, testfunc_t func, void *arg); +extern int run_testsuite(test_suite *p); #endif diff --git a/ee/libcglue/src/fdman.h b/ee/libcglue/src/fdman.h index a58a8b44153..95075afd8fc 100644 --- a/ee/libcglue/src/fdman.h +++ b/ee/libcglue/src/fdman.h @@ -28,11 +28,11 @@ typedef struct { extern __descriptormap_type *__descriptormap[__FILENO_MAX]; -void __fdman_init(); -void __fdman_deinit(); -int __fdman_get_new_descriptor(); -int __fdman_get_dup_descriptor(int fd); -int __fdman_get_dup2_descriptor(int fd, int newfd); -void __fdman_release_descriptor(int fd); +extern void __fdman_init(); +extern void __fdman_deinit(); +extern int __fdman_get_new_descriptor(); +extern int __fdman_get_dup_descriptor(int fd); +extern int __fdman_get_dup2_descriptor(int fd, int newfd); +extern void __fdman_release_descriptor(int fd); #endif diff --git a/ee/libgs/include/libgs.h b/ee/libgs/include/libgs.h index fc218b5c154..70a48dc229f 100644 --- a/ee/libgs/include/libgs.h +++ b/ee/libgs/include/libgs.h @@ -2333,79 +2333,79 @@ extern "C" { /* COMMONLY UDED, LOW LEVEL FUNCTIONS */ /* These Use Gif-Dma To Transfer*/ -int GsSetXYOffset1(u16 x, u16 y); -int GsSetXYOffset2(u16 x, u16 y); -int GsSetScissor1(u16 upper_x, u16 upper_y, u16 lower_x, u16 lower_y); -int GsSetScissor2(u16 upper_x, u16 upper_y, u16 lower_x, u16 lower_y); -int GsSetFrame1(u16 framebuffer_addr, u8 framebuffer_width, u8 psm, u32 draw_mask); -int GsSetFrame2(u16 framebuffer_addr, u8 framebuffer_width, u8 psm, u32 draw_mask); -int GsTextureFlush(void); -int GsSetPixelTest1(u8 enable_alpha_test, u8 alpha_test_method, u8 alpha_reference, u8 alpha_fail_method, u8 enable_dest_alpha_test, u8 dest_alpha_test_mode, u8 enable_zbuff_test, u8 alpha_zbuff_method); -int GsSetPixelTest2(u8 enable_alpha_test, u8 alpha_test_method, u8 alpha_reference, u8 alpha_fail_method, u8 enable_dest_alpha_test, u8 dest_alpha_test_mode, u8 enable_zbuff_test, u8 alpha_zbuff_method); -int GsSelectTexure1(u16 tex_addr, u8 addr_width, u8 tex_pixmode, u16 tex_width, u16 tex_height, u16 clut_addr, u8 clut_pixmode, u8 clut_storagemode,u8 clut_offset); -int GsSelectTexure2(u16 tex_addr, u8 addr_width, u8 tex_pixmode, u16 tex_width, u16 tex_height, u16 clut_addr, u8 clut_pixmode, u8 clut_storagemode,u8 clut_offset); -void GsSetFogColor(u8 r, u8 g, u8 b); -void GsEnableColorClamp(u16 enable); +extern int GsSetXYOffset1(u16 x, u16 y); +extern int GsSetXYOffset2(u16 x, u16 y); +extern int GsSetScissor1(u16 upper_x, u16 upper_y, u16 lower_x, u16 lower_y); +extern int GsSetScissor2(u16 upper_x, u16 upper_y, u16 lower_x, u16 lower_y); +extern int GsSetFrame1(u16 framebuffer_addr, u8 framebuffer_width, u8 psm, u32 draw_mask); +extern int GsSetFrame2(u16 framebuffer_addr, u8 framebuffer_width, u8 psm, u32 draw_mask); +extern int GsTextureFlush(void); +extern int GsSetPixelTest1(u8 enable_alpha_test, u8 alpha_test_method, u8 alpha_reference, u8 alpha_fail_method, u8 enable_dest_alpha_test, u8 dest_alpha_test_mode, u8 enable_zbuff_test, u8 alpha_zbuff_method); +extern int GsSetPixelTest2(u8 enable_alpha_test, u8 alpha_test_method, u8 alpha_reference, u8 alpha_fail_method, u8 enable_dest_alpha_test, u8 dest_alpha_test_mode, u8 enable_zbuff_test, u8 alpha_zbuff_method); +extern int GsSelectTexure1(u16 tex_addr, u8 addr_width, u8 tex_pixmode, u16 tex_width, u16 tex_height, u16 clut_addr, u8 clut_pixmode, u8 clut_storagemode,u8 clut_offset); +extern int GsSelectTexure2(u16 tex_addr, u8 addr_width, u8 tex_pixmode, u16 tex_width, u16 tex_height, u16 clut_addr, u8 clut_pixmode, u8 clut_storagemode,u8 clut_offset); +extern void GsSetFogColor(u8 r, u8 g, u8 b); +extern void GsEnableColorClamp(u16 enable); /* NORMAL FUNCTIONS */ -GsGParam_t *GsGetGParam(void); -void GsResetGraph(short int mode, short int interlace, short int omode, short int ffmode); -void GsResetPath(void); -void GsSetCRTCSettings(u64 settings, u8 alpha_value); +extern GsGParam_t *GsGetGParam(void); +extern void GsResetGraph(short int mode, short int interlace, short int omode, short int ffmode); +extern void GsResetPath(void); +extern void GsSetCRTCSettings(u64 settings, u8 alpha_value); /* Initialise structs with defaults Based On Input*/ -void GsSetDefaultDrawEnv(GS_DRAWENV *drawenv, u16 psm, u16 w, u16 h); -void GsSetDefaultDrawEnvAddress(GS_DRAWENV *drawenv, u16 vram_addr); -void GsSetDefaultDisplayEnv(GS_DISPENV *dispenv, u16 psm, u16 w, u16 h, u16 dx, u16 dy); -void GsSetDefaultDisplayEnvAddress(GS_DISPENV *dispenv, u16 vram_addr); -void GsSetDefaultZBufferEnv(GS_ZENV *zenv, u8 update_mask); -void GsSetDefaultZBufferEnvAddress(GS_ZENV *zenv, u16 vram_addr, u8 psm); +extern void GsSetDefaultDrawEnv(GS_DRAWENV *drawenv, u16 psm, u16 w, u16 h); +extern void GsSetDefaultDrawEnvAddress(GS_DRAWENV *drawenv, u16 vram_addr); +extern void GsSetDefaultDisplayEnv(GS_DISPENV *dispenv, u16 psm, u16 w, u16 h, u16 dx, u16 dy); +extern void GsSetDefaultDisplayEnvAddress(GS_DISPENV *dispenv, u16 vram_addr); +extern void GsSetDefaultZBufferEnv(GS_ZENV *zenv, u8 update_mask); +extern void GsSetDefaultZBufferEnvAddress(GS_ZENV *zenv, u16 vram_addr, u8 psm); /* Execute struct's data (Environments)*/ -void GsPutDrawEnv1(GS_DRAWENV *drawenv); -void GsPutDrawEnv2(GS_DRAWENV *drawenv); -void GsPutDisplayEnv1(GS_DISPENV *dispenv); -void GsPutDisplayEnv2(GS_DISPENV *dispenv); -void GsPutZBufferEnv1(GS_ZENV *zenv); -void GsPutZBufferEnv2(GS_ZENV *zenv); +extern void GsPutDrawEnv1(GS_DRAWENV *drawenv); +extern void GsPutDrawEnv2(GS_DRAWENV *drawenv); +extern void GsPutDisplayEnv1(GS_DISPENV *dispenv); +extern void GsPutDisplayEnv2(GS_DISPENV *dispenv); +extern void GsPutZBufferEnv1(GS_ZENV *zenv); +extern void GsPutZBufferEnv2(GS_ZENV *zenv); /** clear draw buffer with GS_DRAWENV->bg_color color (contex 1) */ -void GsClearDrawEnv1(GS_DRAWENV *drawenv); +extern void GsClearDrawEnv1(GS_DRAWENV *drawenv); /** clear draw buffer with GS_DRAWENV->bg_color color (contex 2) */ -void GsClearDrawEnv2(GS_DRAWENV *drawenv); +extern void GsClearDrawEnv2(GS_DRAWENV *drawenv); /* Gif packet execution*/ -QWORD *GsGifPacketsAlloc(GS_PACKET_TABLE *table, u32 num_qwords); -void GsGifPacketsClear(GS_PACKET_TABLE *table); -int GsGifPacketsExecute(GS_PACKET_TABLE *table, u16 wait); +extern QWORD *GsGifPacketsAlloc(GS_PACKET_TABLE *table, u32 num_qwords); +extern void GsGifPacketsClear(GS_PACKET_TABLE *table); +extern int GsGifPacketsExecute(GS_PACKET_TABLE *table, u16 wait); /* Texture/Image Funtions*/ -int GsLoadImage(const void *source_addr, GS_IMAGE *dest); +extern int GsLoadImage(const void *source_addr, GS_IMAGE *dest); -void GsOverridePrimAttributes(s8 override, s8 iip, s8 tme, s8 fge, s8 abe, s8 aa1, s8 fst, s8 ctxt, s8 fix); -void GsEnableDithering(u8 enable, int mode); -void GsEnableAlphaTransparency1(u16 enable,u16 method,u8 alpha_ref,u16 fail_method); -void GsEnableAlphaTransparency2(u16 enable,u16 method,u8 alpha_ref,u16 fail_method); -void GsEnableZbuffer1(u16 enable,u16 test_method); -void GsEnableZbuffer2(u16 enable,u16 test_method); -void GsEnableAlphaBlending1(u16 enable); -void GsEnableAlphaBlending2(u16 enable); +extern void GsOverridePrimAttributes(s8 override, s8 iip, s8 tme, s8 fge, s8 abe, s8 aa1, s8 fst, s8 ctxt, s8 fix); +extern void GsEnableDithering(u8 enable, int mode); +extern void GsEnableAlphaTransparency1(u16 enable,u16 method,u8 alpha_ref,u16 fail_method); +extern void GsEnableAlphaTransparency2(u16 enable,u16 method,u8 alpha_ref,u16 fail_method); +extern void GsEnableZbuffer1(u16 enable,u16 test_method); +extern void GsEnableZbuffer2(u16 enable,u16 test_method); +extern void GsEnableAlphaBlending1(u16 enable); +extern void GsEnableAlphaBlending2(u16 enable); -void GsDrawSync(int mode); -void GsHSync(int mode); -void GsVSync(int mode); +extern void GsDrawSync(int mode); +extern void GsHSync(int mode); +extern void GsVSync(int mode); /* Vram Allocation */ -int GsVramAllocFrameBuffer(s16 w, s16 h, s16 psm); -int GsVramAllocTextureBuffer(s16 w, s16 h, s16 psm); +extern int GsVramAllocFrameBuffer(s16 w, s16 h, s16 psm); +extern int GsVramAllocTextureBuffer(s16 w, s16 h, s16 psm); /** free texture buffer without freeing frame buffer */ -void GsVramFreeAllTextureBuffer(void); -void GsVramFreeAll(void); +extern void GsVramFreeAllTextureBuffer(void); +extern void GsVramFreeAll(void); /* Just used for buffer swapping*/ -int GsDbGetDrawBuffer(void); -int GsDbGetDisplayBuffer(void); -void GsDbSwapBuffer(void); +extern int GsDbGetDrawBuffer(void); +extern int GsDbGetDisplayBuffer(void); +extern void GsDbSwapBuffer(void); #ifdef __cplusplus } diff --git a/ee/libgs/src/internal.h b/ee/libgs/src/internal.h index 7c5fe178efa..6fc73882e86 100755 --- a/ee/libgs/src/internal.h +++ b/ee/libgs/src/internal.h @@ -1,7 +1,7 @@ -int checkModelVersion(void); +extern int checkModelVersion(void); //DMA management -void GsDmaInit(void); -void GsDmaSend(const void *addr, u32 qwords); -void GsDmaSend_tag(const void *addr, u32 qwords, const GS_GIF_DMACHAIN_TAG *tag); -void GsDmaWait(void); +extern void GsDmaInit(void); +extern void GsDmaSend(const void *addr, u32 qwords); +extern void GsDmaSend_tag(const void *addr, u32 qwords, const GS_GIF_DMACHAIN_TAG *tag); +extern void GsDmaWait(void); diff --git a/ee/libprofglue/include/ps2prof.h b/ee/libprofglue/include/ps2prof.h index 856d7a50222..a12e5b253f9 100644 --- a/ee/libprofglue/include/ps2prof.h +++ b/ee/libprofglue/include/ps2prof.h @@ -22,6 +22,7 @@ extern "C" { * and ignore the result. * Finally, it initializes a new profiler session. */ +extern __attribute__((__no_instrument_function__, __no_profile_instrument_function__)) void gprof_start(void); /** @@ -31,6 +32,7 @@ void gprof_start(void); * @param should_dump If 1, the profiling data will be written to the file. * If 0, the profiling data will be discarded. */ +extern __attribute__((__no_instrument_function__, __no_profile_instrument_function__)) void gprof_stop(const char* filename, int should_dump); diff --git a/ee/libpthreadglue/src/include/ps2_osal.h b/ee/libpthreadglue/src/include/ps2_osal.h index 9583bb7c044..e3fe5befe34 100644 --- a/ee/libpthreadglue/src/include/ps2_osal.h +++ b/ee/libpthreadglue/src/include/ps2_osal.h @@ -24,17 +24,17 @@ typedef int pte_osSemaphoreHandle; typedef int pte_osMutexHandle; #include -pte_osResult pteTlsGlobalInit(int maxEntries); -void * pteTlsThreadInit(void); +extern pte_osResult pteTlsGlobalInit(int maxEntries); +extern void * pteTlsThreadInit(void); -pte_osResult __pteTlsAlloc(unsigned int *pKey); -void * pteTlsGetValue(void *pTlsThreadStruct, unsigned int index); -pte_osResult __pteTlsSetValue(void *pTlsThreadStruct, unsigned int index, void * value); -void *__getTlsStructFromThread(s32 thid); -pte_osResult pteTlsFree(unsigned int index); +extern pte_osResult __pteTlsAlloc(unsigned int *pKey); +extern void * pteTlsGetValue(void *pTlsThreadStruct, unsigned int index); +extern pte_osResult __pteTlsSetValue(void *pTlsThreadStruct, unsigned int index, void * value); +extern void *__getTlsStructFromThread(s32 thid); +extern pte_osResult pteTlsFree(unsigned int index); -void pteTlsThreadDestroy(void * pTlsThreadStruct); -void pteTlsGlobalDestroy(void); +extern void pteTlsThreadDestroy(void * pTlsThreadStruct); +extern void pteTlsGlobalDestroy(void); struct OsalThreadInfo { uint32_t threadNumber; diff --git a/ee/math3d/include/math3d.h b/ee/math3d/include/math3d.h index 7072a28f134..618c3ec1451 100644 --- a/ee/math3d/include/math3d.h +++ b/ee/math3d/include/math3d.h @@ -28,105 +28,105 @@ extern "C" { /* VECTOR FUNCTIONS */ /** Multiply a vector by a matrix, returning a vector. */ -void vector_apply(VECTOR output, VECTOR input0, MATRIX input1); +extern void vector_apply(VECTOR output, VECTOR input0, MATRIX input1); /** Clamp a vector's values by cutting them off at a minimum and maximum value. */ -void vector_clamp(VECTOR output, VECTOR input0, float min, float max); +extern void vector_clamp(VECTOR output, VECTOR input0, float min, float max); /** Copy a vector. */ -void vector_copy(VECTOR output, VECTOR input0); +extern void vector_copy(VECTOR output, VECTOR input0); /** Calculate the inner product of two vectors. Returns a scalar value. */ -float vector_innerproduct(VECTOR input0, VECTOR input1); +extern float vector_innerproduct(VECTOR input0, VECTOR input1); /** Multiply two vectors together. */ -void vector_multiply(VECTOR output, VECTOR input0, VECTOR input1); +extern void vector_multiply(VECTOR output, VECTOR input0, VECTOR input1); /** Normalize a vector by determining its length and dividing its values by this value. */ -void vector_normalize(VECTOR output, VECTOR input0); +extern void vector_normalize(VECTOR output, VECTOR input0); /** Calculate the outer product of two vectors. */ -void vector_outerproduct(VECTOR output, VECTOR input0, VECTOR input1); +extern void vector_outerproduct(VECTOR output, VECTOR input0, VECTOR input1); /** Add two vectors */ -void vector_add(VECTOR sum, VECTOR addend, VECTOR summand); +extern void vector_add(VECTOR sum, VECTOR addend, VECTOR summand); /** Calculate the cross product of two vectors */ -void vector_cross_product(VECTOR product, VECTOR multiplicand, VECTOR multiplier); +extern void vector_cross_product(VECTOR product, VECTOR multiplicand, VECTOR multiplier); /** Calculates the normal of 3 vectors */ -void vector_triangle_normal(VECTOR output, VECTOR a, VECTOR b, VECTOR c); +extern void vector_triangle_normal(VECTOR output, VECTOR a, VECTOR b, VECTOR c); /* MATRIX FUNCTIONS */ /** Copy a matrix. */ -void matrix_copy(MATRIX output, MATRIX input0); +extern void matrix_copy(MATRIX output, MATRIX input0); /** Calculate the inverse of a matrix. */ -void matrix_inverse(MATRIX output, MATRIX input0); +extern void matrix_inverse(MATRIX output, MATRIX input0); /** Multiply two matrices together. */ -void matrix_multiply(MATRIX output, MATRIX input0, MATRIX input1); +extern void matrix_multiply(MATRIX output, MATRIX input0, MATRIX input1); /** Create a rotation matrix and apply it to the specified input matrix. */ -void matrix_rotate(MATRIX output, MATRIX input0, VECTOR input1); +extern void matrix_rotate(MATRIX output, MATRIX input0, VECTOR input1); /** Create a scaling matrix and apply it to the specified input matrix. */ -void matrix_scale(MATRIX output, MATRIX input0, VECTOR input1); +extern void matrix_scale(MATRIX output, MATRIX input0, VECTOR input1); /** Create a translation matrix and apply it to the specified input matrix. */ -void matrix_translate(MATRIX output, MATRIX input0, VECTOR input1); +extern void matrix_translate(MATRIX output, MATRIX input0, VECTOR input1); /** Transpose a matrix. */ -void matrix_transpose(MATRIX output, MATRIX input0); +extern void matrix_transpose(MATRIX output, MATRIX input0); /** Create a unit matrix. */ -void matrix_unit(MATRIX output); +extern void matrix_unit(MATRIX output); /* CREATE FUNCTIONS */ /** Create a local_world matrix given a translation and rotation. * Commonly used to describe an object's position and orientation. */ -void create_local_world(MATRIX local_world, VECTOR translation, VECTOR rotation); +extern void create_local_world(MATRIX local_world, VECTOR translation, VECTOR rotation); /** Create a local_light matrix given a rotation. * Commonly used to transform an object's normals for lighting calculations. */ -void create_local_light(MATRIX local_light, VECTOR rotation); +extern void create_local_light(MATRIX local_light, VECTOR rotation); /** Create a world_view matrix given a translation and rotation. * Commonly used to describe a camera's position and rotation. */ -void create_world_view(MATRIX world_view, VECTOR translation, VECTOR rotation); +extern void create_world_view(MATRIX world_view, VECTOR translation, VECTOR rotation); /** Create a view_screen matrix given an aspect and clipping plane values. * Functionally similar to the opengl function: glFrustum() */ -void create_view_screen(MATRIX view_screen, float aspect, float left, float right, float bottom, float top, float near, float far); +extern void create_view_screen(MATRIX view_screen, float aspect, float left, float right, float bottom, float top, float near, float far); /** Create a local_screen matrix given a local_world, world_view and view_screen matrix. * Commonly used with vector_apply() to transform vertices for rendering. */ -void create_local_screen(MATRIX local_screen, MATRIX local_world, MATRIX world_view, MATRIX view_screen); +extern void create_local_screen(MATRIX local_screen, MATRIX local_world, MATRIX world_view, MATRIX view_screen); /* CALCULATE FUNCTIONS */ /** Ambient light source. */ -#define LIGHT_AMBIENT 0 +#define LIGHT_AMBIENT 0 /** Directional light source. */ -#define LIGHT_DIRECTIONAL 1 +#define LIGHT_DIRECTIONAL 1 /** Transform an array of normals by applying the specified local_light matrix. */ -void calculate_normals(VECTOR *output, int count, VECTOR *normals, MATRIX local_light); +extern void calculate_normals(VECTOR *output, int count, VECTOR *normals, MATRIX local_light); /** Calculate the light intensity for an array of lights given an array of normal values. */ -void calculate_lights(VECTOR *output, int count, VECTOR *normals, VECTOR *light_directions, VECTOR *light_colours, const int *light_types, int light_count); +extern void calculate_lights(VECTOR *output, int count, VECTOR *normals, VECTOR *light_directions, VECTOR *light_colours, const int *light_types, int light_count); /** Calculate colour values given an array of light intensity values. */ -void calculate_colours(VECTOR *output, int count, VECTOR *colours, VECTOR *lights); +extern void calculate_colours(VECTOR *output, int count, VECTOR *colours, VECTOR *lights); /** Calculate vertex values by applying the specific local_screen matrix. */ -void calculate_vertices(VECTOR *output, int count, VECTOR *vertices, MATRIX local_screen); +extern void calculate_vertices(VECTOR *output, int count, VECTOR *vertices, MATRIX local_screen); #ifdef __cplusplus } diff --git a/ee/mpeg/include/libmpeg.h b/ee/mpeg/include/libmpeg.h index 6d5e5ed4547..c6245706678 100644 --- a/ee/mpeg/include/libmpeg.h +++ b/ee/mpeg/include/libmpeg.h @@ -57,8 +57,8 @@ typedef struct MPEGSequenceInfo { extern "C" { #endif -void MPEG_Initialize ( int ( * ) ( void* ), void*, void* ( * ) ( void*, MPEGSequenceInfo* ), void*, s64* ); -void MPEG_Destroy ( void ); +extern void MPEG_Initialize ( int ( * ) ( void* ), void*, void* ( * ) ( void*, MPEGSequenceInfo* ), void*, s64* ); +extern void MPEG_Destroy ( void ); extern int ( *MPEG_Picture ) ( void*, s64* ); #ifdef __cplusplus diff --git a/ee/mpeg/src/libmpeg_internal.h b/ee/mpeg/src/libmpeg_internal.h index 7c4de534722..1828b01bcdd 100644 --- a/ee/mpeg/src/libmpeg_internal.h +++ b/ee/mpeg/src/libmpeg_internal.h @@ -149,48 +149,48 @@ typedef struct _MPEGContext { } _MPEGContext; -void _MPEG_Initialize ( _MPEGContext*, int ( * ) ( void* ), void*, int* ); -void _MPEG_Destroy ( void ); -int _MPEG_CSCImage ( void*, void*, int ); -void _MPEG_SetDefQM ( int ); -void _MPEG_SetQM ( int ); -int _MPEG_GetMBAI ( void ); -int _MPEG_GetMBType ( void ); -int _MPEG_GetMotionCode ( void ); -int _MPEG_GetDMVector ( void ); -unsigned int _MPEG_NextStartCode ( void ); -void _MPEG_AlignBits ( void ); -unsigned int _MPEG_GetBits ( unsigned int ); -unsigned int _MPEG_ShowBits ( unsigned int ); -void _MPEG_SetIDCP ( void ); -void _MPEG_SetQSTIVFAS ( void ); -void _MPEG_SetPCT ( unsigned int ); -void _MPEG_BDEC ( int, int, int, int, void* ); -int _MPEG_WaitBDEC ( void ); -void _MPEG_dma_ref_image ( _MPEGMacroBlock8*, _MPEGMotion*, s64, int ); -void _MPEG_do_mc ( _MPEGMotion* ); -void _MPEG_put_luma ( u8* a1, u16* a2, int a3, int a4, int var1, int ta ); -void _MPEG_put_luma_X ( u8* a1, u16* a2, int a3, int a4, int var1, int ta ); -void _MPEG_put_luma_Y ( u8* a1, u16* a2, int a3, int a4, int var1, int ta ); -void _MPEG_put_luma_XY ( u8* a1, u16* a2, int a3, int a4, int var1, int ta ); -void _MPEG_put_chroma ( u8* a1, u16* a2, int a3, int a4, int var1, int ta ); -void _MPEG_put_chroma_X ( u8* a1, u16* a2, int a3, int a4, int var1, int ta ); -void _MPEG_put_chroma_Y ( u8* a1, u16* a2, int a3, int a4, int var1, int ta ); -void _MPEG_put_chroma_XY ( u8* a1, u16* a2, int a3, int a4, int var1, int ta ); -void _MPEG_avg_luma ( u8* a1, u16* a2, int a3, int a4, int var1, int ta ); -void _MPEG_avg_luma_X ( u8* a1, u16* a2, int a3, int a4, int var1, int ta ); -void _MPEG_avg_luma_Y ( u8* a1, u16* a2, int a3, int a4, int var1, int ta ); -void _MPEG_avg_luma_XY ( u8* a1, u16* a2, int a3, int a4, int var1, int ta ); -void _MPEG_avg_chroma ( u8* a1, u16* a2, int a3, int a4, int var1, int ta ); -void _MPEG_avg_chroma_X ( u8* a1, u16* a2, int a3, int a4, int var1, int ta ); -void _MPEG_avg_chroma_Y ( u8* a1, u16* a2, int a3, int a4, int var1, int ta ); -void _MPEG_avg_chroma_XY ( u8* a1, u16* a2, int a3, int a4, int var1, int ta ); -void _MPEG_put_block_fr ( _MPEGMotions* ); -void _MPEG_put_block_fl ( _MPEGMotions* ); -void _MPEG_put_block_il ( _MPEGMotions* ); -void _MPEG_add_block_ilfl ( _MPEGMotions* ); -void _MPEG_add_block_frfr ( _MPEGMotions* ); -void _MPEG_add_block_frfl ( _MPEGMotions* ); -void _MPEG_Suspend ( void ); -void _MPEG_Resume ( void ); +extern void _MPEG_Initialize ( _MPEGContext*, int ( * ) ( void* ), void*, int* ); +extern void _MPEG_Destroy ( void ); +extern int _MPEG_CSCImage ( void*, void*, int ); +extern void _MPEG_SetDefQM ( int ); +extern void _MPEG_SetQM ( int ); +extern int _MPEG_GetMBAI ( void ); +extern int _MPEG_GetMBType ( void ); +extern int _MPEG_GetMotionCode ( void ); +extern int _MPEG_GetDMVector ( void ); +extern unsigned int _MPEG_NextStartCode ( void ); +extern void _MPEG_AlignBits ( void ); +extern unsigned int _MPEG_GetBits ( unsigned int ); +extern unsigned int _MPEG_ShowBits ( unsigned int ); +extern void _MPEG_SetIDCP ( void ); +extern void _MPEG_SetQSTIVFAS ( void ); +extern void _MPEG_SetPCT ( unsigned int ); +extern void _MPEG_BDEC ( int, int, int, int, void* ); +extern int _MPEG_WaitBDEC ( void ); +extern void _MPEG_dma_ref_image ( _MPEGMacroBlock8*, _MPEGMotion*, s64, int ); +extern void _MPEG_do_mc ( _MPEGMotion* ); +extern void _MPEG_put_luma ( u8* a1, u16* a2, int a3, int a4, int var1, int ta ); +extern void _MPEG_put_luma_X ( u8* a1, u16* a2, int a3, int a4, int var1, int ta ); +extern void _MPEG_put_luma_Y ( u8* a1, u16* a2, int a3, int a4, int var1, int ta ); +extern void _MPEG_put_luma_XY ( u8* a1, u16* a2, int a3, int a4, int var1, int ta ); +extern void _MPEG_put_chroma ( u8* a1, u16* a2, int a3, int a4, int var1, int ta ); +extern void _MPEG_put_chroma_X ( u8* a1, u16* a2, int a3, int a4, int var1, int ta ); +extern void _MPEG_put_chroma_Y ( u8* a1, u16* a2, int a3, int a4, int var1, int ta ); +extern void _MPEG_put_chroma_XY ( u8* a1, u16* a2, int a3, int a4, int var1, int ta ); +extern void _MPEG_avg_luma ( u8* a1, u16* a2, int a3, int a4, int var1, int ta ); +extern void _MPEG_avg_luma_X ( u8* a1, u16* a2, int a3, int a4, int var1, int ta ); +extern void _MPEG_avg_luma_Y ( u8* a1, u16* a2, int a3, int a4, int var1, int ta ); +extern void _MPEG_avg_luma_XY ( u8* a1, u16* a2, int a3, int a4, int var1, int ta ); +extern void _MPEG_avg_chroma ( u8* a1, u16* a2, int a3, int a4, int var1, int ta ); +extern void _MPEG_avg_chroma_X ( u8* a1, u16* a2, int a3, int a4, int var1, int ta ); +extern void _MPEG_avg_chroma_Y ( u8* a1, u16* a2, int a3, int a4, int var1, int ta ); +extern void _MPEG_avg_chroma_XY ( u8* a1, u16* a2, int a3, int a4, int var1, int ta ); +extern void _MPEG_put_block_fr ( _MPEGMotions* ); +extern void _MPEG_put_block_fl ( _MPEGMotions* ); +extern void _MPEG_put_block_il ( _MPEGMotions* ); +extern void _MPEG_add_block_ilfl ( _MPEGMotions* ); +extern void _MPEG_add_block_frfr ( _MPEGMotions* ); +extern void _MPEG_add_block_frfl ( _MPEGMotions* ); +extern void _MPEG_Suspend ( void ); +extern void _MPEG_Resume ( void ); #endif /* __libmpeg_internal_H */ diff --git a/ee/network/netman/src/include/internal.h b/ee/network/netman/src/include/internal.h index cd82cddaca0..d071e903f62 100644 --- a/ee/network/netman/src/include/internal.h +++ b/ee/network/netman/src/include/internal.h @@ -1,2 +1,2 @@ -void NetManToggleGlobalNetIFLinkState(unsigned char state); -void NetManUpdateStackNIFLinkState(void); +extern void NetManToggleGlobalNetIFLinkState(unsigned char state); +extern void NetManUpdateStackNIFLinkState(void); diff --git a/ee/network/netman/src/include/rpc_client.h b/ee/network/netman/src/include/rpc_client.h index 9f2dd232550..b84a99f83ae 100644 --- a/ee/network/netman/src/include/rpc_client.h +++ b/ee/network/netman/src/include/rpc_client.h @@ -1,6 +1,6 @@ -int NetManInitRPCClient(void); -void NetManDeinitRPCClient(void); -int NetManRPCRegisterNetworkStack(void); -int NetManRPCUnregisterNetworkStack(void); -int NetManRpcIoctl(unsigned int command, void *arg, unsigned int arg_len, void *output, unsigned int length); -void NetManRpcNetIFXmit(void); +extern int NetManInitRPCClient(void); +extern void NetManDeinitRPCClient(void); +extern int NetManRPCRegisterNetworkStack(void); +extern int NetManRPCUnregisterNetworkStack(void); +extern int NetManRpcIoctl(unsigned int command, void *arg, unsigned int arg_len, void *output, unsigned int length); +extern void NetManRpcNetIFXmit(void); diff --git a/ee/network/netman/src/include/rpc_server.h b/ee/network/netman/src/include/rpc_server.h index 3c91e1cdb3e..dfe20574c11 100644 --- a/ee/network/netman/src/include/rpc_server.h +++ b/ee/network/netman/src/include/rpc_server.h @@ -1,3 +1,3 @@ -int NetManInitRPCServer(void); -void NetManDeinitRPCServer(void); -int NetManRPCAllocRxBuffers(void); +extern int NetManInitRPCServer(void); +extern void NetManDeinitRPCServer(void); +extern int NetManRPCAllocRxBuffers(void); diff --git a/ee/network/tcpip/include/ps2ip.h b/ee/network/tcpip/include/ps2ip.h index 19dab8d3290..2b04d7e2d9a 100644 --- a/ee/network/tcpip/include/ps2ip.h +++ b/ee/network/tcpip/include/ps2ip.h @@ -25,25 +25,25 @@ #include /** Initializes PS2IP. Specify a dummy address like "169.254.0.1" if DHCP is to be used, before enabling DHCP via ps2ip_setconfig(). */ -int ps2ipInit(struct ip4_addr *ip_address, struct ip4_addr *subnet_mask, struct ip4_addr *gateway); -void ps2ipDeinit(void); +extern int ps2ipInit(struct ip4_addr *ip_address, struct ip4_addr *subnet_mask, struct ip4_addr *gateway); +extern void ps2ipDeinit(void); /** * Use to specify the number of H-sync ticks per milisecond (Default: 16). - * Use this function to keep timings accurate, if a mode like 480P (~31KHz H-sync) is used instead of NTSC/PAL (~16KHz H-sync). + * Use this function to keep timings accurate, if a mode like 480P (~31KHz H-sync) is used instead of NTSC/PAL (~16KHz H-sync). * This function is obsolete, so it is stubbed for compatibility purposes. */ -void ps2ipSetHsyncTicksPerMSec(unsigned char ticks); +extern void ps2ipSetHsyncTicksPerMSec(unsigned char ticks); -err_t ps2ip_input(struct pbuf *p, struct netif *inp); +extern err_t ps2ip_input(struct pbuf *p, struct netif *inp); /* From include/netif/etharp.h: */ -err_t etharp_output(struct netif *netif, struct pbuf *q, const ip_addr_t *ipaddr); +extern err_t etharp_output(struct netif *netif, struct pbuf *q, const ip_addr_t *ipaddr); /* From include/lwip/tcpip.h: */ -err_t tcpip_input(struct pbuf *p, struct netif *inp); +extern err_t tcpip_input(struct pbuf *p, struct netif *inp); /* From include/lwip/netif.h: */ -struct netif *netif_add(struct netif *netif, +extern struct netif *netif_add(struct netif *netif, #if LWIP_IPV4 const ip4_addr_t *ipaddr, const ip4_addr_t *netmask, const ip4_addr_t *gw, #endif /* LWIP_IPV4 */ @@ -53,23 +53,23 @@ struct netif *netif_add(struct netif *netif, * The name is of the form "et0", where the first two letters are the "name" field in the * netif structure, and the digit is in the num field in the same structure. */ -struct netif *netif_find(const char *name); -void netif_set_default(struct netif *netif); -void netif_set_ipaddr(struct netif *netif, const ip4_addr_t *ipaddr); -void netif_set_netmask(struct netif *netif, const ip4_addr_t *netmask); -void netif_set_gw(struct netif *netif, const ip4_addr_t *gw); -void netif_set_up(struct netif *netif); -void netif_set_down(struct netif *netif); +extern struct netif *netif_find(const char *name); +extern void netif_set_default(struct netif *netif); +extern void netif_set_ipaddr(struct netif *netif, const ip4_addr_t *ipaddr); +extern void netif_set_netmask(struct netif *netif, const ip4_addr_t *netmask); +extern void netif_set_gw(struct netif *netif, const ip4_addr_t *gw); +extern void netif_set_up(struct netif *netif); +extern void netif_set_down(struct netif *netif); -struct pbuf* pbuf_alloc(pbuf_layer l, u16 size, pbuf_type type); -void pbuf_realloc(struct pbuf *p, u16 size); -u8 pbuf_header(struct pbuf *p, s16 header_size); -void pbuf_ref(struct pbuf *p); -u8 pbuf_free(struct pbuf *p); -u8 pbuf_clen(struct pbuf *p); -void pbuf_chain(struct pbuf *h, struct pbuf *t); -struct pbuf* pbuf_dechain(struct pbuf *p); -struct pbuf* pbuf_take(struct pbuf *f); -struct pbuf* pbuf_coalesce(struct pbuf *p, pbuf_layer layer); +extern struct pbuf* pbuf_alloc(pbuf_layer l, u16 size, pbuf_type type); +extern void pbuf_realloc(struct pbuf *p, u16 size); +extern u8 pbuf_header(struct pbuf *p, s16 header_size); +extern void pbuf_ref(struct pbuf *p); +extern u8 pbuf_free(struct pbuf *p); +extern u8 pbuf_clen(struct pbuf *p); +extern void pbuf_chain(struct pbuf *h, struct pbuf *t); +extern struct pbuf* pbuf_dechain(struct pbuf *p); +extern struct pbuf* pbuf_take(struct pbuf *f); +extern struct pbuf* pbuf_coalesce(struct pbuf *p, pbuf_layer layer); #endif /* __PS2IP_H__ */ diff --git a/ee/network/tcpip/src/include/arch/sys_arch.h b/ee/network/tcpip/src/include/arch/sys_arch.h index bcb02fb465a..8a2f8c5d47e 100644 --- a/ee/network/tcpip/src/include/arch/sys_arch.h +++ b/ee/network/tcpip/src/include/arch/sys_arch.h @@ -29,6 +29,6 @@ typedef int sys_thread_t; #define mem_clib_malloc(size) memalign(64,size) #define mem_clib_calloc(count,size) ps2ip_calloc64(count,size) -void *ps2ip_calloc64(size_t n, size_t size); +extern void *ps2ip_calloc64(size_t n, size_t size); #endif /* __SYS_ARCH_H__ */ diff --git a/ee/network/tcpip/src/ps2ip_internal.h b/ee/network/tcpip/src/ps2ip_internal.h index 301b247024b..59d333b7399 100644 --- a/ee/network/tcpip/src/ps2ip_internal.h +++ b/ee/network/tcpip/src/ps2ip_internal.h @@ -30,6 +30,6 @@ typedef struct #define dbgprintf(args...) #endif -err_t ps2ip_input(struct pbuf *p, struct netif *inp); +extern err_t ps2ip_input(struct pbuf *p, struct netif *inp); #endif // !defined(IOP_PS2IP_INTERNAL_H) diff --git a/ee/network/tcpip/src/ps2ipee.h b/ee/network/tcpip/src/ps2ipee.h index d0f7f4bbcd5..19cfb00090d 100644 --- a/ee/network/tcpip/src/ps2ipee.h +++ b/ee/network/tcpip/src/ps2ipee.h @@ -18,51 +18,51 @@ extern "C" { #endif /* From include/lwip/sockets.h: */ -int lwip_accept(int s, struct sockaddr *addr, socklen_t *addrlen); -int lwip_bind(int s, const struct sockaddr *name, socklen_t namelen); -int lwip_shutdown(int s, int how); -int lwip_getpeername (int s, struct sockaddr *name, socklen_t *namelen); -int lwip_getsockname (int s, struct sockaddr *name, socklen_t *namelen); -int lwip_getsockopt (int s, int level, int optname, void *optval, socklen_t *optlen); -int lwip_setsockopt (int s, int level, int optname, const void *optval, socklen_t optlen); -int lwip_close(int s); -int lwip_connect(int s, const struct sockaddr *name, socklen_t namelen); -int lwip_listen(int s, int backlog); -int lwip_recv(int s, void *mem, size_t len, int flags); -int lwip_read(int s, void *mem, size_t len); -int lwip_recvfrom(int s, void *mem, size_t len, int flags, struct sockaddr *from, socklen_t *fromlen); -int lwip_send(int s, const void *dataptr, size_t size, int flags); -int lwip_sendto(int s, const void *dataptr, size_t size, int flags, const struct sockaddr *to, socklen_t tolen); -int lwip_socket(int domain, int type, int protocol); -int lwip_write(int s, const void *dataptr, size_t size); -int lwip_select(int maxfdp1, fd_set *readset, fd_set *writeset, fd_set *exceptset, struct timeval *timeout); -int lwip_ioctl(int s, long cmd, void *argp); -int lwip_fcntl(int s, int cmd, int val); +extern int lwip_accept(int s, struct sockaddr *addr, socklen_t *addrlen); +extern int lwip_bind(int s, const struct sockaddr *name, socklen_t namelen); +extern int lwip_shutdown(int s, int how); +extern int lwip_getpeername (int s, struct sockaddr *name, socklen_t *namelen); +extern int lwip_getsockname (int s, struct sockaddr *name, socklen_t *namelen); +extern int lwip_getsockopt (int s, int level, int optname, void *optval, socklen_t *optlen); +extern int lwip_setsockopt (int s, int level, int optname, const void *optval, socklen_t optlen); +extern int lwip_close(int s); +extern int lwip_connect(int s, const struct sockaddr *name, socklen_t namelen); +extern int lwip_listen(int s, int backlog); +extern int lwip_recv(int s, void *mem, size_t len, int flags); +extern int lwip_read(int s, void *mem, size_t len); +extern int lwip_recvfrom(int s, void *mem, size_t len, int flags, struct sockaddr *from, socklen_t *fromlen); +extern int lwip_send(int s, const void *dataptr, size_t size, int flags); +extern int lwip_sendto(int s, const void *dataptr, size_t size, int flags, const struct sockaddr *to, socklen_t tolen); +extern int lwip_socket(int domain, int type, int protocol); +extern int lwip_write(int s, const void *dataptr, size_t size); +extern int lwip_select(int maxfdp1, fd_set *readset, fd_set *writeset, fd_set *exceptset, struct timeval *timeout); +extern int lwip_ioctl(int s, long cmd, void *argp); +extern int lwip_fcntl(int s, int cmd, int val); -int ps2ip_setconfig(const t_ip_info* ip_info); -int ps2ip_getconfig(char* netif_name,t_ip_info* ip_info); +extern int ps2ip_setconfig(const t_ip_info* ip_info); +extern int ps2ip_getconfig(char* netif_name,t_ip_info* ip_info); /* From include/lwip/inet.h: */ -u32 ipaddr_addr(const char *cp); -int ip4addr_aton(const char *cp, ip4_addr_t *addr); +extern u32 ipaddr_addr(const char *cp); +extern int ip4addr_aton(const char *cp, ip4_addr_t *addr); /** returns ptr to static buffer; not reentrant! */ -char *ip4addr_ntoa(const ip4_addr_t *addr); -char *ip4addr_ntoa_r(const ip4_addr_t *addr, char *buf, int buflen); +extern char *ip4addr_ntoa(const ip4_addr_t *addr); +extern char *ip4addr_ntoa_r(const ip4_addr_t *addr, char *buf, int buflen); #ifdef PS2IP_DNS /* From include/lwip/netdb.h: */ -struct hostent *lwip_gethostbyname(const char *name); -int lwip_gethostbyname_r(const char *name, struct hostent *ret, char *buf, +extern struct hostent *lwip_gethostbyname(const char *name); +extern int lwip_gethostbyname_r(const char *name, struct hostent *ret, char *buf, size_t buflen, struct hostent **result, int *h_errnop); -void lwip_freeaddrinfo(struct addrinfo *ai); -int lwip_getaddrinfo(const char *nodename, +extern void lwip_freeaddrinfo(struct addrinfo *ai); +extern int lwip_getaddrinfo(const char *nodename, const char *servname, const struct addrinfo *hints, struct addrinfo **res); /* From include/lwip/dns.h: */ -void dns_setserver(u8 numdns, const ip_addr_t *dnsserver); -const ip_addr_t* dns_getserver(u8 numdns); +extern void dns_setserver(u8 numdns, const ip_addr_t *dnsserver); +extern const ip_addr_t* dns_getserver(u8 numdns); #endif #ifdef __cplusplus diff --git a/ee/packet/include/packet.h b/ee/packet/include/packet.h index 063fbcd9018..17f2fa4621a 100644 --- a/ee/packet/include/packet.h +++ b/ee/packet/include/packet.h @@ -32,16 +32,16 @@ extern "C" { #endif /** Allocate a new packet for use, size in quadwords. */ -packet_t *packet_init(int qwords, int type); +extern packet_t *packet_init(int qwords, int type); /** Reset the packet quadword counter and zero out data. */ -void packet_reset(packet_t *packet); +extern void packet_reset(packet_t *packet); /** Free the space allocated by packet. */ -void packet_free(packet_t *packet); +extern void packet_free(packet_t *packet); /** Advances the qwc and returns the current qword count. */ -qword_t *packet_increment_qwc(packet_t *packet, int num); +extern qword_t *packet_increment_qwc(packet_t *packet, int num); /** For those that like getters and setters */ static inline qword_t *packet_get_qword(packet_t *packet) diff --git a/ee/packet2/include/packet2.h b/ee/packet2/include/packet2.h index f5f9f2df5bb..cf9edd8e413 100644 --- a/ee/packet2/include/packet2.h +++ b/ee/packet2/include/packet2.h @@ -48,7 +48,7 @@ extern "C" * so remember to align memory! * @returns Pointer to packet2 on success or NULL if memory allocation fail. */ - packet2_t *packet2_create(u16 qwords, enum Packet2Type type, enum Packet2Mode mode, u8 tte); + extern packet2_t *packet2_create(u16 qwords, enum Packet2Type type, enum Packet2Mode mode, u8 tte); /** * Create new packet2 with given data pointer. @@ -64,13 +64,13 @@ extern "C" * so remember to align memory! * @returns Pointer to packet2 on success or NULL if memory allocation fail. */ - packet2_t *packet2_create_from(qword_t *base, qword_t *next, u16 qwords, enum Packet2Type type, enum Packet2Mode mode, u8 tte); + extern packet2_t *packet2_create_from(qword_t *base, qword_t *next, u16 qwords, enum Packet2Type type, enum Packet2Mode mode, u8 tte); /** * Free packet2 memory. * @param packet2 Pointer to packet2. */ - void packet2_free(packet2_t *packet2); + extern void packet2_free(packet2_t *packet2); /** * Reset packet. @@ -80,7 +80,7 @@ extern "C" * @param packet2 Pointer to packet. * @param clear_mem If >0, data is cleared via memset(). SLOW! */ - void packet2_reset(packet2_t *packet2, u8 clear_mem); + extern void packet2_reset(packet2_t *packet2, u8 clear_mem); /** * Update current position of packet buffer. @@ -185,16 +185,16 @@ extern "C" * @param packet2 Pointer to packet. * @param clear_mem Count of qwords, type 0 for all. */ - void packet2_print(packet2_t *packet2, u32 qw_count); + extern void packet2_print(packet2_t *packet2, u32 qw_count); /** * Print amount of qwords of packet. * @param packet2 Pointer to packet. */ - void packet2_print_qw_count(packet2_t *packet2); + extern void packet2_print_qw_count(packet2_t *packet2); /** Copy data from b packet into a packet with memcpy() */ - void packet2_add(packet2_t *a, packet2_t *b); + extern void packet2_add(packet2_t *a, packet2_t *b); /** Returns count of added qwords into packet. */ static inline u32 packet2_get_qw_count(packet2_t *packet2) { return ((u32)packet2->next - (u32)packet2->base) >> 4; } diff --git a/ee/packet2/include/packet2_vif.h b/ee/packet2/include/packet2_vif.h index 6d75cf8b316..69242bf23a8 100644 --- a/ee/packet2/include/packet2_vif.h +++ b/ee/packet2/include/packet2_vif.h @@ -390,7 +390,7 @@ extern "C" * @param start Start address. * @param end End address. */ - void packet2_vif_add_micro_program(packet2_t *packet2, u32 dest, u32 *start, u32 *end); + extern void packet2_vif_add_micro_program(packet2_t *packet2, u32 dest, u32 *start, u32 *end); #ifdef __cplusplus } diff --git a/ee/rpc/ahx/include/ahx_rpc.h b/ee/rpc/ahx/include/ahx_rpc.h index 845694a9d8a..8f88728ac61 100644 --- a/ee/rpc/ahx/include/ahx_rpc.h +++ b/ee/rpc/ahx/include/ahx_rpc.h @@ -36,7 +36,7 @@ extern "C" { * Sends a call the the loaded AHX IRX, telling it to set * things up ready for loading a song. */ -int AHX_Init(); +extern int AHX_Init(); /** AHX LongSongBuffer * @@ -46,7 +46,7 @@ int AHX_Init(); * * @return number of subsongs. */ -int AHX_LoadSongBuffer(char* songdata, int songsize); +extern int AHX_LoadSongBuffer(char* songdata, int songsize); /** AHX LongSongBuffer * @@ -55,7 +55,7 @@ int AHX_LoadSongBuffer(char* songdata, int songsize); * * @return number of subsongs. */ -int AHX_LoadSong(char* filename); +extern int AHX_LoadSong(char* filename); /** AHX Play Subsong * @@ -64,7 +64,7 @@ int AHX_LoadSong(char* filename); * by checking the values returned by AHX_LoadSong() and * AHX_LoadSongBuffer(); */ -int AHX_SubSong(int songNo); +extern int AHX_SubSong(int songNo); /** AHX Set Volume * @@ -72,7 +72,7 @@ int AHX_SubSong(int songNo); * the output volume of the SPU2. volumePercentage argument * can range from 0 (0% silence) to 100 (100% full volume) */ -int AHX_SetVolume(int volumePercentage); +extern int AHX_SetVolume(int volumePercentage); /** AHX Set Boost * @@ -82,7 +82,7 @@ int AHX_SetVolume(int volumePercentage); * twice as load as a boost value of 0. A boost value of 3 * is twice as load as 2 etc etc (ala DB) */ -int AHX_SetBoost(int boostValue); +extern int AHX_SetBoost(int boostValue); /** AHX Toggle Oversampling * @@ -91,7 +91,7 @@ int AHX_SetBoost(int boostValue); * sounds nasty/slows down for a lot of songs - use with * caution (or not at all) */ -int AHX_ToggleOversampling(); +extern int AHX_ToggleOversampling(); /** AHX Quit * @@ -99,21 +99,21 @@ int AHX_ToggleOversampling(); * This frees up IOP mem, quites threads, deletes semaphores * and all that jazz.... */ -int AHX_Quit(); +extern int AHX_Quit(); /** AHX Play * * Sends a call the the loaded AHX IRX, telling it to play * the currently loaded song. */ -int AHX_Play(); +extern int AHX_Play(); /** AHX Pause * * Sends a call the the loaded AHX IRX, telling it to pause * the currently loaded song. */ -int AHX_Pause(); +extern int AHX_Pause(); #ifdef __cplusplus } diff --git a/ee/rpc/audsrv/include/audsrv.h b/ee/rpc/audsrv/include/audsrv.h index a1219944941..e758b2f611a 100755 --- a/ee/rpc/audsrv/include/audsrv.h +++ b/ee/rpc/audsrv/include/audsrv.h @@ -67,12 +67,12 @@ typedef int (*audsrv_callback_t)(void *arg); /** Initializes audsrv library * @returns error code */ -int audsrv_init(); +extern int audsrv_init(); /** Shutdowns audsrv * @returns AUDSRV_ERR_NOERROR */ -int audsrv_quit(); +extern int audsrv_quit(); /** Configures audio stream * @param fmt output specification structure @@ -83,7 +83,7 @@ int audsrv_quit(); * change the format at any point. You might want to stop audio prior * to that, to prevent mismatched audio output. */ -int audsrv_set_format(struct audsrv_fmt_t *fmt); +extern int audsrv_set_format(struct audsrv_fmt_t *fmt); /** Blocks until there is enough space to enqueue chunk * @param bytes size of chunk requested to be enqueued (in bytes) @@ -92,13 +92,13 @@ int audsrv_set_format(struct audsrv_fmt_t *fmt); * Blocks until there are enough space to store the upcoming chunk * in audsrv's internal ring buffer. */ -int audsrv_wait_audio(int bytes); +extern int audsrv_wait_audio(int bytes); /** Sets output volume * @param vol volume in percentage * @returns error code */ -int audsrv_set_volume(int volume); +extern int audsrv_set_volume(int volume); /** Uploads audio buffer to SPU * @param chunk audio buffer @@ -110,33 +110,33 @@ int audsrv_set_volume(int volume); * interfering with fluent streaming. The buffer and buflen are given * in host format (i.e, 11025hz 8bit stereo.) */ -int audsrv_play_audio(const char *chunk, int bytes); +extern int audsrv_play_audio(const char *chunk, int bytes); /** Stops audio from playing. * @returns status code */ -int audsrv_stop_audio(); +extern int audsrv_stop_audio(); /** Returns the last error audsrv raised * @returns error code */ -int audsrv_get_error(); +extern int audsrv_get_error(); /** Translates audsrv_get_error() response to readable string * @returns string representation of error code */ -const char *audsrv_get_error_string(); +extern const char *audsrv_get_error_string(); /** Starts playing the request track * @param track segment to play * @returns status code */ -int audsrv_play_cd(int track); +extern int audsrv_play_cd(int track); /** Stops CD from playing. * @returns status code */ -int audsrv_stop_cd(); +extern int audsrv_stop_cd(); /** Returns the current playing sector * @returns sector number @@ -144,7 +144,7 @@ int audsrv_stop_cd(); * CDDA type discs have sector size of 2352 bytes. There are 75 * such sectors per second. */ -int audsrv_get_cdpos(); +extern int audsrv_get_cdpos(); /** Returns the current playing sector, relative to track * @returns sector number @@ -157,49 +157,49 @@ int audsrv_get_cdpos(); * * where ff is the frame number, 1/75th of a second. */ -int audsrv_get_trackpos(); +extern int audsrv_get_trackpos(); /** Returns the number of tracks available on the CD in tray * @returns positive track count, or negative error status code */ -int audsrv_get_numtracks(); +extern int audsrv_get_numtracks(); /** Returns the first sector for the given track * @param track track index, must be between 1 and the trackcount * @returns sector number, or negative status code */ -int audsrv_get_track_offset(int track); +extern int audsrv_get_track_offset(int track); /** Pauses CDDA playing * @returns error status code * * If CDDA is paused, no operation is taken */ -int audsrv_pause_cd(); +extern int audsrv_pause_cd(); /** Resumes CDDA playing * @returns error status code * * If CDDA was not paused, no operation is taken */ -int audsrv_resume_cd(); +extern int audsrv_resume_cd(); /** Starts playing at a specific sector * @param start first sector to play * @param end last sector to play * @returns status code */ -int audsrv_play_sectors(int start, int end); +extern int audsrv_play_sectors(int start, int end); /** Returns the status of the CD tray (open, closed, seeking etc.) * @returns value as defined in libcdvd, negative on error */ -int audsrv_get_cd_status(); +extern int audsrv_get_cd_status(); /** Returns the type of disc currently in tray * @returns value as defined in libcdvd, negative on error */ -int audsrv_get_cd_type(); +extern int audsrv_get_cd_type(); /** Installs a callback function to be called when ringbuffer has enough * space to transmit the request number of bytes. @@ -208,7 +208,7 @@ int audsrv_get_cd_type(); * @param arg extra parameter to pass to callback function later * @returns AUDSRV_ERR_NOERROR, AUDSRV_ERR_ARGS if amount is greater than sizeof(ringbuf) */ -int audsrv_on_fillbuf(int amount, audsrv_callback_t cb, void *arg); +extern int audsrv_on_fillbuf(int amount, audsrv_callback_t cb, void *arg); /** Initializes adpcm unit of audsrv * @returns zero on success, negative value on error @@ -216,7 +216,7 @@ int audsrv_on_fillbuf(int amount, audsrv_callback_t cb, void *arg); * Frees up all memory taken by samples, and stops all voices from * being played. This can be called multiple times */ -int audsrv_adpcm_init(); +extern int audsrv_adpcm_init(); /** Sets output volume for the specified voice channel. * @param ch Voice channel ID @@ -224,7 +224,7 @@ int audsrv_adpcm_init(); * @param pan left/right offset [-100 .. 0 .. 100] * @returns 0 on success, negative otherwise */ -int audsrv_adpcm_set_volume_and_pan(int ch, int vol, int pan); +extern int audsrv_adpcm_set_volume_and_pan(int ch, int vol, int pan); #define audsrv_adpcm_set_volume(ch, vol) audsrv_adpcm_set_volume_and_pan(ch, vol, 0) //For backward-compatibility /** Uploads a sample to SPU2 memory @@ -233,7 +233,7 @@ int audsrv_adpcm_set_volume_and_pan(int ch, int vol, int pan); * @param size size of sample (including the header) * @returns zero on success, negative error code otherwise */ -int audsrv_load_adpcm(audsrv_adpcm_t *adpcm, void *buffer, int size); +extern int audsrv_load_adpcm(audsrv_adpcm_t *adpcm, void *buffer, int size); /** Plays an adpcm sample already uploaded with audsrv_load_adpcm() * @param ch channel identifier. Specifies one of the 24 voice channel to play the ADPCM channel on. @@ -245,27 +245,27 @@ int audsrv_load_adpcm(audsrv_adpcm_t *adpcm, void *buffer, int size); * When ch is set to a valid channel ID, -AUDSRV_ERR_NO_MORE_CHANNELS is returned if the channel is currently in use. * Trying to play a sample which is unavailable will result in -AUDSRV_ERR_ARGS */ -int audsrv_ch_play_adpcm(int ch, audsrv_adpcm_t *adpcm); +extern int audsrv_ch_play_adpcm(int ch, audsrv_adpcm_t *adpcm); #define audsrv_play_adpcm(adpcm) audsrv_ch_play_adpcm(-1, adpcm) //For backward-compatibility /** Check if a sample is currently playing on the given channel * @returns 1 if playing, 0 if not */ -int audsrv_is_adpcm_playing(int ch, audsrv_adpcm_t *adpcm); +extern int audsrv_is_adpcm_playing(int ch, audsrv_adpcm_t *adpcm); /** Remove an adpcm sample uploaded with audsrv_load_adpcm() from the list of loaded sounds * @param id sample identifier, as specified in load() * * SPU memory is freed only when there are no sounds in the list that where loaded after the ones that have been freed */ -int audsrv_free_adpcm(audsrv_adpcm_t *adpcm); +extern int audsrv_free_adpcm(audsrv_adpcm_t *adpcm); /** Installs a callback function upon completion of a cdda track * @param cb your callback * @param arg extra parameter to pass to callback function later * @returns status code */ -int audsrv_on_cdda_stop(audsrv_callback_t cb, void *arg); +extern int audsrv_on_cdda_stop(audsrv_callback_t cb, void *arg); /** Returns the number of bytes that can be queued * @returns number of bytes left in the ring buffer @@ -274,14 +274,14 @@ int audsrv_on_cdda_stop(audsrv_callback_t cb, void *arg); * is the total bytes that can be queued, without collision of the reading * head with the writing head. */ -int audsrv_available(); +extern int audsrv_available(); /** Returns the number of bytes already in queue * @returns byte count * Returns the number of bytes that are already in the ring buffer. */ -int audsrv_queued(); +extern int audsrv_queued(); #ifdef __cplusplus } diff --git a/ee/rpc/camera/include/ps2cam_rpc.h b/ee/rpc/camera/include/ps2cam_rpc.h index 22a354d2b5e..eb9b8ae4784 100644 --- a/ee/rpc/camera/include/ps2cam_rpc.h +++ b/ee/rpc/camera/include/ps2cam_rpc.h @@ -146,19 +146,19 @@ typedef struct extern "C" { #endif -int PS2CamInit(int mode); -int PS2CamGetIRXVersion(void); -int PS2CamGetDeviceCount(void); -int PS2CamOpenDevice(int device_index); -int PS2CamCloseDevice(int handle); -int PS2CamGetDeviceStatus(int handle); -int PS2CamGetDeviceInfo(int handle, PS2CAM_DEVICE_INFO *info); -int PS2CamSetDeviceBandwidth(int handle, char bandwidth); -int PS2CamReadPacket(int handle); -int PS2CamSetLEDMode(int handle, int mode); -int PS2CamSetDeviceConfig(int handle, PS2CAM_DEVICE_CONFIG *cfg); - -int PS2CamExtractFrame(int handle, char *buffer, int bufsize); +extern int PS2CamInit(int mode); +extern int PS2CamGetIRXVersion(void); +extern int PS2CamGetDeviceCount(void); +extern int PS2CamOpenDevice(int device_index); +extern int PS2CamCloseDevice(int handle); +extern int PS2CamGetDeviceStatus(int handle); +extern int PS2CamGetDeviceInfo(int handle, PS2CAM_DEVICE_INFO *info); +extern int PS2CamSetDeviceBandwidth(int handle, char bandwidth); +extern int PS2CamReadPacket(int handle); +extern int PS2CamSetLEDMode(int handle, int mode); +extern int PS2CamSetDeviceConfig(int handle, PS2CAM_DEVICE_CONFIG *cfg); + +extern int PS2CamExtractFrame(int handle, char *buffer, int bufsize); #ifdef __cplusplus } diff --git a/ee/rpc/camera/samples/libjpg.h b/ee/rpc/camera/samples/libjpg.h index a04ea0cde1b..af7493c1da2 100644 --- a/ee/rpc/camera/samples/libjpg.h +++ b/ee/rpc/camera/samples/libjpg.h @@ -11,15 +11,15 @@ typedef struct { void *priv; } jpgData; -jpgData *jpgOpen(char *filename); -jpgData *jpgOpenRAW(u8 *data, int size); -jpgData *jpgCreate(char *filename, u8 *data, int width, int height, int bpp); -jpgData *jpgCreateRAW(u8 *data, int width, int height, int bpp); -int jpgCompressImage(jpgData *jpg); -int jpgCompressImageRAW(jpgData *jpg, u8 **dest); -int jpgReadImage(jpgData *jpg, u8 *dest); -void jpgClose(jpgData *jpg); -int jpgScreenshot(const char* pFilename,unsigned int VramAdress, - unsigned int Width, unsigned int Height, unsigned int Psm); +extern jpgData *jpgOpen(char *filename); +extern jpgData *jpgOpenRAW(u8 *data, int size); +extern jpgData *jpgCreate(char *filename, u8 *data, int width, int height, int bpp); +extern jpgData *jpgCreateRAW(u8 *data, int width, int height, int bpp); +extern int jpgCompressImage(jpgData *jpg); +extern int jpgCompressImageRAW(jpgData *jpg, u8 **dest); +extern int jpgReadImage(jpgData *jpg, u8 *dest); +extern void jpgClose(jpgData *jpg); +extern int jpgScreenshot(const char* pFilename,unsigned int VramAdress, + unsigned int Width, unsigned int Height, unsigned int Psm); #endif /* __LIBJPG_H__ */ diff --git a/ee/rpc/cdvd/include/libcdvd.h b/ee/rpc/cdvd/include/libcdvd.h index 5936d405cf1..ce1773eaa74 100644 --- a/ee/rpc/cdvd/include/libcdvd.h +++ b/ee/rpc/cdvd/include/libcdvd.h @@ -32,14 +32,14 @@ extern "C" { * @param mode read mode * @return 1 if successful, 0 if error */ -int sceCdReadIOPMem(u32 lbn, u32 sectors, void *buf, sceCdRMode *mode); +extern int sceCdReadIOPMem(u32 lbn, u32 sectors, void *buf, sceCdRMode *mode); /** wait for disc to finish all n-commands * (shouldnt really need to call this yourself) * * @return SCECdNotReady (6) if busy; SCECdComplete (2) if ready; 0 if error */ -int sceCdNCmdDiskReady(void); +extern int sceCdNCmdDiskReady(void); /** Controls spindle speed? Not sure what it really does. * SUPPORTED IN XCDVDMAN/XCDVDFSV ONLY @@ -47,7 +47,7 @@ int sceCdNCmdDiskReady(void); * @param speed Speed mode. * @return 1 on success, 0 on failure. */ -int sceCdSpinCtrlEE(u32 speed); +extern int sceCdSpinCtrlEE(u32 speed); #ifdef __cplusplus } diff --git a/ee/rpc/cdvd/src/internal.h b/ee/rpc/cdvd/src/internal.h index f3bedf2bf13..f07760391e3 100644 --- a/ee/rpc/cdvd/src/internal.h +++ b/ee/rpc/cdvd/src/internal.h @@ -44,9 +44,9 @@ extern u8 nCmdRecvBuff[]; extern "C" { #endif -void _CdSemaInit(void); -void _CdGenericCallbackFunction(void *funcNum); -int _CdSyncS(int mode); +extern void _CdSemaInit(void); +extern void _CdGenericCallbackFunction(void *funcNum); +extern int _CdSyncS(int mode); #ifdef __cplusplus } diff --git a/ee/rpc/filexio/include/fileXio_rpc.h b/ee/rpc/filexio/include/fileXio_rpc.h index 0da1c366467..68a725f62f2 100644 --- a/ee/rpc/filexio/include/fileXio_rpc.h +++ b/ee/rpc/filexio/include/fileXio_rpc.h @@ -34,41 +34,41 @@ extern "C" { #endif -int fileXioInit(void); -void fileXioExit(void); -void fileXioSetBlockMode(int blocking); -int fileXioWaitAsync(int mode, int *retVal); +extern int fileXioInit(void); +extern void fileXioExit(void); +extern void fileXioSetBlockMode(int blocking); +extern int fileXioWaitAsync(int mode, int *retVal); -void fileXioStop(); -int fileXioGetDeviceList(struct fileXioDevice deviceEntry[], unsigned int req_entries); -int fileXioGetdir(const char* pathname, struct fileXioDirEntry DirEntry[], unsigned int req_entries); -int fileXioMount(const char* mountpoint, const char* blockdev, int flag); -int fileXioUmount(const char* mountpoint); -int fileXioCopyfile(const char* source, const char* dest, int mode); -int fileXioMkdir(const char* pathname, int mode); -int fileXioRmdir(const char* pathname); -int fileXioRemove(const char* pathname); -int fileXioRename(const char* source, const char* dest); -int fileXioSymlink(const char* source, const char* dest); -int fileXioReadlink(const char* source, char* buf, unsigned int buflen); -int fileXioChdir(const char* pathname); -int fileXioOpen(const char* source, int flags, ...); -int fileXioClose(int fd); -int fileXioRead(int fd, void *buf, int size); -int fileXioWrite(int fd, const void *buf, int size); -int fileXioLseek(int fd, int offset, int whence); -s64 fileXioLseek64(int fd, s64 offset, int whence); -int fileXioChStat(const char *name, iox_stat_t *stat, int mask); -int fileXioGetStat(const char *name, iox_stat_t *stat); -int fileXioFormat(const char *dev, const char *blockdev, const void *args, int arglen); -int fileXioSync(const char *devname, int flag); -int fileXioDopen(const char *name); -int fileXioDclose(int fd); -int fileXioDread(int fd, iox_dirent_t *dirent); -int fileXioDevctl(const char *name, int cmd, void *arg, unsigned int arglen, void *buf,unsigned int buflen); -int fileXioIoctl(int fd, int cmd, void *arg); -int fileXioIoctl2(int fd, int command, void *arg, unsigned int arglen, void *buf, unsigned int buflen); -int fileXioSetRWBufferSize(int size); +extern void fileXioStop(); +extern int fileXioGetDeviceList(struct fileXioDevice deviceEntry[], unsigned int req_entries); +extern int fileXioGetdir(const char* pathname, struct fileXioDirEntry DirEntry[], unsigned int req_entries); +extern int fileXioMount(const char* mountpoint, const char* blockdev, int flag); +extern int fileXioUmount(const char* mountpoint); +extern int fileXioCopyfile(const char* source, const char* dest, int mode); +extern int fileXioMkdir(const char* pathname, int mode); +extern int fileXioRmdir(const char* pathname); +extern int fileXioRemove(const char* pathname); +extern int fileXioRename(const char* source, const char* dest); +extern int fileXioSymlink(const char* source, const char* dest); +extern int fileXioReadlink(const char* source, char* buf, unsigned int buflen); +extern int fileXioChdir(const char* pathname); +extern int fileXioOpen(const char* source, int flags, ...); +extern int fileXioClose(int fd); +extern int fileXioRead(int fd, void *buf, int size); +extern int fileXioWrite(int fd, const void *buf, int size); +extern int fileXioLseek(int fd, int offset, int whence); +extern s64 fileXioLseek64(int fd, s64 offset, int whence); +extern int fileXioChStat(const char *name, iox_stat_t *stat, int mask); +extern int fileXioGetStat(const char *name, iox_stat_t *stat); +extern int fileXioFormat(const char *dev, const char *blockdev, const void *args, int arglen); +extern int fileXioSync(const char *devname, int flag); +extern int fileXioDopen(const char *name); +extern int fileXioDclose(int fd); +extern int fileXioDread(int fd, iox_dirent_t *dirent); +extern int fileXioDevctl(const char *name, int cmd, void *arg, unsigned int arglen, void *buf,unsigned int buflen); +extern int fileXioIoctl(int fd, int cmd, void *arg); +extern int fileXioIoctl2(int fd, int command, void *arg, unsigned int arglen, void *buf, unsigned int buflen); +extern int fileXioSetRWBufferSize(int size); #ifdef __cplusplus } diff --git a/ee/rpc/hdd/include/libhdd.h b/ee/rpc/hdd/include/libhdd.h index 084c851dc97..3326ec528aa 100644 --- a/ee/rpc/hdd/include/libhdd.h +++ b/ee/rpc/hdd/include/libhdd.h @@ -68,14 +68,14 @@ typedef struct extern "C" { #endif -int hddCheckPresent(); -int hddCheckFormatted(); -int hddFormat(); -int hddGetFilesystemList(t_hddFilesystem hddFs[], int maxEntries); -void hddGetInfo(t_hddInfo *info); -int hddMakeFilesystem(int fsSizeMB, char *name, int type); -int hddRemoveFilesystem(t_hddFilesystem *fs); -int hddExpandFilesystem(t_hddFilesystem *fs, int extraMB); +extern int hddCheckPresent(); +extern int hddCheckFormatted(); +extern int hddFormat(); +extern int hddGetFilesystemList(t_hddFilesystem hddFs[], int maxEntries); +extern void hddGetInfo(t_hddInfo *info); +extern int hddMakeFilesystem(int fsSizeMB, char *name, int type); +extern int hddRemoveFilesystem(t_hddFilesystem *fs); +extern int hddExpandFilesystem(t_hddFilesystem *fs, int extraMB); #ifdef __cplusplus } diff --git a/ee/rpc/keyboard/include/libkbd.h b/ee/rpc/keyboard/include/libkbd.h index 9153ee86d0e..e5487a1bbee 100644 --- a/ee/rpc/keyboard/include/libkbd.h +++ b/ee/rpc/keyboard/include/libkbd.h @@ -26,33 +26,33 @@ extern "C" { #endif /** Initialise the keyboard library */ -int PS2KbdInit(void); +extern int PS2KbdInit(void); /** Reads 1 character from the keyboard */ -int PS2KbdRead(char *key); +extern int PS2KbdRead(char *key); /** Reads 1 raw character from the keyboard */ -int PS2KbdReadRaw(PS2KbdRawKey *key); +extern int PS2KbdReadRaw(PS2KbdRawKey *key); /** Sets the read mode to normal or raw */ -int PS2KbdSetReadmode(u32 readMode); +extern int PS2KbdSetReadmode(u32 readMode); /** Sets the blocking mode on or off */ -int PS2KbdSetBlockingMode(u32 readMode); +extern int PS2KbdSetBlockingMode(u32 readMode); /** Sets the repeat rate in millseconds */ -int PS2KbdSetRepeatRate(u32 repeat); +extern int PS2KbdSetRepeatRate(u32 repeat); /** Sets all connected keyboards leds */ -int PS2KbdSetLeds(u8 leds); +extern int PS2KbdSetLeds(u8 leds); /** Sets the current keymap */ -int PS2KbdSetKeymap(PS2KbdKeyMap *keymaps); +extern int PS2KbdSetKeymap(PS2KbdKeyMap *keymaps); /** Sets the control key mappings */ -int PS2KbdSetCtrlmap(u8 *ctrlmap); +extern int PS2KbdSetCtrlmap(u8 *ctrlmap); /** Sets the alt key mappings */ -int PS2KbdSetAltmap(u8 *altmap); +extern int PS2KbdSetAltmap(u8 *altmap); /** Sets the special key mappings */ -int PS2KbdSetSpecialmap(u8 *special); +extern int PS2KbdSetSpecialmap(u8 *special); /** Flushes the keyboard buffer */ -int PS2KbdFlushBuffer(void); +extern int PS2KbdFlushBuffer(void); /** Resets the keymap to the default US mapping */ -int PS2KbdResetKeymap(void); +extern int PS2KbdResetKeymap(void); /** Close down the keyboard library */ -int PS2KbdClose(void); +extern int PS2KbdClose(void); #ifdef __cplusplus } diff --git a/ee/rpc/memorycard/include/libmc.h b/ee/rpc/memorycard/include/libmc.h index a6201acb769..f0662bda394 100644 --- a/ee/rpc/memorycard/include/libmc.h +++ b/ee/rpc/memorycard/include/libmc.h @@ -205,13 +205,13 @@ extern "C" { * @param type MC_TYPE_MC = use MCSERV/MCMAN; MC_TYPE_XMC = use XMCSERV/XMCMAN * @return 0 = successful; < 0 = error */ -int mcInit(int type); +extern int mcInit(int type); /** get memcard state - * mcSync result: 0 = same card as last getInfo call - * -1 = formatted card inserted since last getInfo call - * -2 = unformatted card inserted since last getInfo call - * < -2 = memcard access error (could be due to accessing psx memcard) + * mcSync result: 0 = same card as last getInfo call + * -1 = formatted card inserted since last getInfo call + * -2 = unformatted card inserted since last getInfo call + * < -2 = memcard access error (could be due to accessing psx memcard) * * @param port port number * @param slot slot number @@ -220,11 +220,11 @@ int mcInit(int type); * @param format pointer to get whether or not the card is formatted (Note: Originally, sceMcGetInfo didn't have a 5th argument for returning the format status. As this is emulated based on the return value of sceMcSync() when rom0:MCSERV is used, please keep track of the return value from sceMcSync instead!) * @return 0 = successful; < 0 = error */ -int mcGetInfo(int port, int slot, int* type, int* free, int* format); +extern int mcGetInfo(int port, int slot, int* type, int* free, int* format); /** open a file on memcard - * mcSync returns: 0 or more = file descriptor (success) - * < 0 = error + * mcSync returns: 0 or more = file descriptor (success) + * < 0 = error * * @param port port number * @param slot slot number @@ -232,75 +232,75 @@ int mcGetInfo(int port, int slot, int* type, int* free, int* format); * @param mode open file mode (O_RDWR, O_CREAT, etc) * @return 0 = successful; < 0 = error */ -int mcOpen(int port, int slot, const char *name, int mode); +extern int mcOpen(int port, int slot, const char *name, int mode); /** close an open file on memcard - * mcSync returns: 0 if closed successfully - * < 0 = error + * mcSync returns: 0 if closed successfully + * < 0 = error * * @param fd file descriptor of open file * @return 0 successful; < 0 = error */ -int mcClose(int fd); +extern int mcClose(int fd); /** move memcard file pointer - * mcSync returns: 0 or more = offset of file pointer from start of file - * < 0 = error + * mcSync returns: 0 or more = offset of file pointer from start of file + * < 0 = error * * @param fd file descriptor * @param offset number of bytes from origin * @param origin initial position for offset * @return 0 = successful; < 0 = error */ -int mcSeek(int fd, int offset, int origin); +extern int mcSeek(int fd, int offset, int origin); /** read from file on memcard - * mcSync returns: 0 or more = number of bytes read from memcard - * < 0 = error + * mcSync returns: 0 or more = number of bytes read from memcard + * < 0 = error * * @param fd file descriptor * @param buffer buffer to read to * @param size number of bytes to read * @return 0 = successful; < 0 = error */ -int mcRead(int fd, void *buffer, int size); +extern int mcRead(int fd, void *buffer, int size); /** write to file on memcard - * mcSync returns: 0 or more = number of bytes written to memcard - * < 0 = error + * mcSync returns: 0 or more = number of bytes written to memcard + * < 0 = error * * @param fd file descriptor * @param buffer to write from write * @param size number of bytes to read * @return 0 = successful; < 0 = error */ -int mcWrite(int fd, const void *buffer, int size); +extern int mcWrite(int fd, const void *buffer, int size); /** flush file cache to memcard - * mcSync returns: 0 if ok - * < 0 if error + * mcSync returns: 0 if ok + * < 0 if error * * @param fd file descriptor * @return 0 = successful; < 0 = error */ -int mcFlush(int fd); +extern int mcFlush(int fd); /** create a dir - * mcSync returns: 0 if ok - * < 0 if error + * mcSync returns: 0 if ok + * < 0 if error * * @param port port number * @param slot slot number * @param name directory name * @return 0 = successful; < 0 = error */ -int mcMkDir(int port, int slot, const char* name); +extern int mcMkDir(int port, int slot, const char* name); /** change current dir * (can also get current dir) - * mcSync returns: 0 if ok - * < 0 if error + * mcSync returns: 0 if ok + * < 0 if error * * @param port port number * @param slot slot number @@ -308,12 +308,12 @@ int mcMkDir(int port, int slot, const char* name); * @param currentDir buffer to get current dir (use 0 if not needed) * @return 0 = successful; < 0 = error */ -int mcChdir(int port, int slot, const char* newDir, char* currentDir); +extern int mcChdir(int port, int slot, const char* newDir, char* currentDir); /** get memcard filelist - * mcSync result: 0 or more = number of file entries obtained (success) - * -2 = unformatted card - * -4 = dirname error + * mcSync result: 0 or more = number of file entries obtained (success) + * -2 = unformatted card + * -4 = dirname error * * @param port port number of memcard * @param slot slot number of memcard @@ -323,11 +323,11 @@ int mcChdir(int port, int slot, const char* newDir, char* currentDir); * @param table mc table array * @return 0 = successful; < 0 = error */ -int mcGetDir(int port, int slot, const char *name, unsigned mode, int maxent, sceMcTblGetDir* table); +extern int mcGetDir(int port, int slot, const char *name, unsigned mode, int maxent, sceMcTblGetDir* table); /** change file information - * mcSync returns: 0 if ok - * < 0 if error + * mcSync returns: 0 if ok + * < 0 if error * * @param port port number * @param slot slot number @@ -336,54 +336,54 @@ int mcGetDir(int port, int slot, const char *name, unsigned mode, int maxent, sc * @param flags flags to show which data is valid * @return 0 = successful; < 0 = error */ -int mcSetFileInfo(int port, int slot, const char* name, const sceMcTblGetDir* info, unsigned flags); +extern int mcSetFileInfo(int port, int slot, const char* name, const sceMcTblGetDir* info, unsigned flags); /** delete file - * mcSync returns: 0 if deleted successfully - * < 0 if error + * mcSync returns: 0 if deleted successfully + * < 0 if error * * @param port port number to delete from * @param slot slot number to delete from * @param name filename to delete * @return 0 = successful; < 0 = error */ -int mcDelete(int port, int slot, const char *name); +extern int mcDelete(int port, int slot, const char *name); /** format memory card - * mcSync returns: 0 if ok - * < 0 if error + * mcSync returns: 0 if ok + * < 0 if error * * @param port port number * @param slot slot number * @return 0 = success; -1 = error */ -int mcFormat(int port, int slot); +extern int mcFormat(int port, int slot); /** unformat memory card - * mcSync returns: 0 if ok - * < 0 if error + * mcSync returns: 0 if ok + * < 0 if error * * @param port port number * @param slot slot number * @return 0 = success; -1 = error */ -int mcUnformat(int port, int slot); +extern int mcUnformat(int port, int slot); /** get free space info - * mcSync returns: 0 or more = number of free entries (success) - * < 0 if error + * mcSync returns: 0 or more = number of free entries (success) + * < 0 if error * * @param port port number * @param slot slot number * @param path path to be checked * @return 0 or more = number of empty entries; -1 = error */ -int mcGetEntSpace(int port, int slot, const char* path); +extern int mcGetEntSpace(int port, int slot, const char* path); /** rename file or dir on memcard * Note: rom0:MCSERV does not support this. - * mcSync returns: 0 if ok - * < 0 if error + * mcSync returns: 0 if ok + * < 0 if error * * @param port port number * @param slot slot number @@ -391,12 +391,12 @@ int mcGetEntSpace(int port, int slot, const char* path); * @param newName new name to give to file/dir * @return 1 = success; < 0 = error */ -int mcRename(int port, int slot, const char* oldName, const char* newName); +extern int mcRename(int port, int slot, const char* oldName, const char* newName); /** Erases a block on the memory card. * Note: rom0:XMCSERV does not support this. - * mcSync returns: 0 if ok - * < 0 if error + * mcSync returns: 0 if ok + * < 0 if error * * @param port port number * @param slot slot number @@ -404,12 +404,12 @@ int mcRename(int port, int slot, const char* oldName, const char* newName); * @param mode Mode: -1 to inhibit ECC recalculation of the erased block's pages (useful if sceMcWritePage is used to fill in its contents later on), 0 for normal operation. * @return 0 = success; -1 = error */ -int mcEraseBlock(int port, int slot, int block, int mode); +extern int mcEraseBlock(int port, int slot, int block, int mode); /** Reads a page from the memory card. * Note: rom0:XMCSERV does not support this. - * mcSync returns: 0 if ok - * < 0 if error + * mcSync returns: 0 if ok + * < 0 if error * * @param port port number * @param slot slot number @@ -417,12 +417,12 @@ int mcEraseBlock(int port, int slot, int block, int mode); * @param buffer Pointer to buffer that will contain the read data. * @return 0 = success; -1 = error */ -int mcReadPage(int port, int slot, unsigned int page, void *buffer); +extern int mcReadPage(int port, int slot, unsigned int page, void *buffer); /** Writes a page to the memory card. (The block which the page resides on must be erased first!) * Note: rom0:XMCSERV does not support this. - * mcSync returns: 0 if ok - * < 0 if error + * mcSync returns: 0 if ok + * < 0 if error * * @param port port number * @param slot slot number @@ -430,18 +430,18 @@ int mcReadPage(int port, int slot, unsigned int page, void *buffer); * @param buffer Pointer to buffer containing data to be written. * @return 0 = success; -1 = error */ -int mcWritePage(int port, int slot, int page, const void *buffer); +extern int mcWritePage(int port, int slot, int page, const void *buffer); /** change mcserv thread priority * (I don't think this is implemented properly) * Note: rom0:MCSERV does not support this. - * mcSync returns: 0 if ok - * < 0 if error + * mcSync returns: 0 if ok + * < 0 if error * * @param level thread priority * @return 0 = success; -1 = error */ -int mcChangeThreadPriority(int level); +extern int mcChangeThreadPriority(int level); /** wait for mc functions to finish or check if they have finished yet * @@ -450,13 +450,13 @@ int mcChangeThreadPriority(int level); * @param result pointer for storing result of function if it finishes * @return 0 = function is still executing (mode=1); 1 = function has finished executing; -1 = no function registered */ -int mcSync(int mode, int *cmd, int *result); +extern int mcSync(int mode, int *cmd, int *result); /** Reset (force deinit) of library * * @return 0 = success */ -int mcReset(void); +extern int mcReset(void); #ifdef __cplusplus } diff --git a/ee/rpc/mouse/include/libmouse.h b/ee/rpc/mouse/include/libmouse.h index faa704f918f..db77a1f73fb 100644 --- a/ee/rpc/mouse/include/libmouse.h +++ b/ee/rpc/mouse/include/libmouse.h @@ -25,26 +25,26 @@ extern "C" { #endif /** Initialise the RPC library */ -int PS2MouseInit(void); +extern int PS2MouseInit(void); /** Reads the current mouse data (depending on read mode) */ -int PS2MouseRead(PS2MouseData *); +extern int PS2MouseRead(PS2MouseData *); /** Sets the read mode */ -int PS2MouseSetReadMode(u32 readMode); +extern int PS2MouseSetReadMode(u32 readMode); /** Gets the current read mode */ -u32 PS2MouseGetReadMode(); - -int PS2MouseSetThres(u32 thres); -u32 PS2MouseGetThres(); -int PS2MouseSetAccel(float accel); -float PS2MouseGetAccel(); -int PS2MouseSetBoundary(int minx, int maxx, int miny, int maxy); -int PS2MouseGetBoundary(int *minx, int *maxx, int *miny, int *maxy); -int PS2MouseSetPosition(int x, int y); -int PS2MouseReset(); -u32 PS2MouseEnum(); -int PS2MouseSetDblClickTime(u32 msec); -u32 PS2MouseGetDblClickTIme(); -u32 PS2MouseGetVersion(); +extern u32 PS2MouseGetReadMode(); + +extern int PS2MouseSetThres(u32 thres); +extern u32 PS2MouseGetThres(); +extern int PS2MouseSetAccel(float accel); +extern float PS2MouseGetAccel(); +extern int PS2MouseSetBoundary(int minx, int maxx, int miny, int maxy); +extern int PS2MouseGetBoundary(int *minx, int *maxx, int *miny, int *maxy); +extern int PS2MouseSetPosition(int x, int y); +extern int PS2MouseReset(); +extern u32 PS2MouseEnum(); +extern int PS2MouseSetDblClickTime(u32 msec); +extern u32 PS2MouseGetDblClickTIme(); +extern u32 PS2MouseGetVersion(); #ifdef __cplusplus } diff --git a/ee/rpc/multitap/include/libmtap.h b/ee/rpc/multitap/include/libmtap.h index 68ee72ae7da..2c815feeb06 100644 --- a/ee/rpc/multitap/include/libmtap.h +++ b/ee/rpc/multitap/include/libmtap.h @@ -23,25 +23,25 @@ extern "C" { /** Initialise the multitap library. * @return 1 on success; 1 on failure */ -int mtapInit(void); +extern int mtapInit(void); /** Open a port for the multitap. * @param port specifies the port that is to be monitored as a multitap connection destination. * @return 1 on success; !1 on failure. */ -int mtapPortOpen(int port); +extern int mtapPortOpen(int port); /** Closes a port for the multitap. * @param port is a port that is to be closed (must have been previously opened by mtapPortOpen). * @return 1 on success; !1 on failure. */ -int mtapPortClose(int port); +extern int mtapPortClose(int port); /** Checks if a multitap is connected to an opened port. * @param port is the port to be checked. * @return 1 if a multitap exists on the specified port; !1 if there isno multitap on the specified port. */ -int mtapGetConnection(int port); +extern int mtapGetConnection(int port); #ifdef __cplusplus } diff --git a/ee/rpc/pad/include/libpad.h b/ee/rpc/pad/include/libpad.h index 5577f643397..2e3af6fe497 100644 --- a/ee/rpc/pad/include/libpad.h +++ b/ee/rpc/pad/include/libpad.h @@ -126,7 +126,7 @@ extern "C" { * @param mode Must be set to 0. * @return == 1 => OK */ -int padInit(int mode); +extern int padInit(int mode); /** Initialise pad ports. Automatically called by padInit(), there is no need to call this function directly. * @param mode Must be set to 0. @@ -137,7 +137,7 @@ int padInit(int mode); * * @return == 1 => OK */ -int padPortInit(int mode); +extern int padPortInit(int mode); /** Ends all pad communication * Note: PADMAN from release 1.3.4 does not have padPortInit implemented. @@ -146,7 +146,7 @@ int padPortInit(int mode); * * @return == 1 => OK */ -int padEnd(void); +extern int padEnd(void); /** * @param port Port to open @@ -155,7 +155,7 @@ int padEnd(void); * Must be a 64-byte aligned address. For the old libpad, at least 16-bytes alignment. * @return != 0 => OK */ -int padPortOpen(int port, int slot, void *padArea); +extern int padPortOpen(int port, int slot, void *padArea); /** * Closes an opened port. @@ -164,7 +164,7 @@ int padPortOpen(int port, int slot, void *padArea); * @param slot Slot to close * @return != 0 => OK */ -int padPortClose(int port, int slot); +extern int padPortClose(int port, int slot); /** Read pad data * @param port Port number of the pad to get the status for. @@ -172,88 +172,88 @@ int padPortClose(int port, int slot); * @param data A pointer to a 32 byte array where the result is stored * @return != 0 => OK */ -unsigned char padRead(int port, int slot, struct padButtonStatus *data); +extern unsigned char padRead(int port, int slot, struct padButtonStatus *data); /** Get current pad state * Wait until state == 6 (Ready) before trying to access the pad */ -int padGetState(int port, int slot); +extern int padGetState(int port, int slot); /** Get pad request state*/ -unsigned char padGetReqState(int port, int slot); +extern unsigned char padGetReqState(int port, int slot); /** Set pad request state (after a param setting) * No need to export this one perhaps.. */ -int padSetReqState(int port, int slot, int state); +extern int padSetReqState(int port, int slot, int state); /* * Debug print functions */ -void padStateInt2String(int state, char buf[16]); -void padReqStateInt2String(int state, char buf[16]); +extern void padStateInt2String(int state, char buf[16]); +extern void padReqStateInt2String(int state, char buf[16]); /** Returns # slots on the PS2 (usally 2) */ -int padGetPortMax(void); +extern int padGetPortMax(void); /** Returns # slots the port has (usually 1) * probably 4 if using a multi tap (not tested) */ -int padGetSlotMax(int port); +extern int padGetSlotMax(int port); /** Returns the padman.irx version * NOT SUPPORTED on module rom0:padman */ -int padGetModVersion(); +extern int padGetModVersion(); /** Get pad info (digital (4), dualshock (7), etc..) * * @return 3 - KONAMI GUN; 4 - DIGITAL PAD; 5 - JOYSTICK; 6 - NAMCO GUN; 7 - DUAL SHOCK */ -int padInfoMode(int port, int slot, int infoMode, int index); +extern int padInfoMode(int port, int slot, int infoMode, int index); /** * mode = 1, -> Analog/dual shock enabled; mode = 0 -> Digital * lock = 3 -> Mode not changeable by user */ -int padSetMainMode(int port, int slot, int mode, int lock); +extern int padSetMainMode(int port, int slot, int mode, int lock); /** Check if the pad has pressure sensitive buttons */ -int padInfoPressMode(int port, int slot); +extern int padInfoPressMode(int port, int slot); /** Pressure sensitive mode ON */ -int padEnterPressMode(int port, int slot); +extern int padEnterPressMode(int port, int slot); /** Check for newer version * Pressure sensitive mode OFF */ -int padExitPressMode(int port, int slot); +extern int padExitPressMode(int port, int slot); /* * Dunno if these need to be exported */ -int padGetButtonMask(int port, int slot); -int padSetButtonInfo(int port, int slot, int buttonInfo); +extern int padGetButtonMask(int port, int slot); +extern int padSetButtonInfo(int port, int slot, int buttonInfo); /** Get actuator status for this controller * If padInfoAct(port, slot, -1, 0) != 0, the controller has actuators * (i think ;) ) */ -unsigned char padInfoAct(int port, int slot, int word, int byte); +extern unsigned char padInfoAct(int port, int slot, int word, int byte); /** Initalise actuators. On dual shock controller: * act_align[0] = 0 enables 'small' engine * act_align[1] = 1 enables 'big' engine * set act_align[2-5] to 0xff (disable) */ -int padSetActAlign(int port, int slot, const char act_align[6]); +extern int padSetActAlign(int port, int slot, const char act_align[6]); /** Set actuator status on dual shock controller, * act_align[0] = 0/1 turns off/on 'small' engine * act_align[1] = 0-255 sets 'big' engine speed */ -int padSetActDirect(int port, int slot, char act_align[6]); +extern int padSetActDirect(int port, int slot, char act_align[6]); /** Returns whether the device at port,slot is connected (1 = connected) * Appears to have been removed very early during the PS2's lifetime. @@ -261,7 +261,7 @@ int padSetActDirect(int port, int slot, char act_align[6]); * * NOT SUPPORTED with module rom0:padman */ -int padGetConnection(int port, int slot); +extern int padGetConnection(int port, int slot); #ifdef __cplusplus } diff --git a/ee/rpc/poweroff/include/libpwroff.h b/ee/rpc/poweroff/include/libpwroff.h index 9b1f04d5ed2..d5004e76c69 100644 --- a/ee/rpc/poweroff/include/libpwroff.h +++ b/ee/rpc/poweroff/include/libpwroff.h @@ -53,7 +53,7 @@ typedef void (*poweroff_callback)(void *arg); * @details A service thread with a default priority of POWEROFF_THREAD_PRIORITY * will be created. */ -int poweroffInit(void); +extern int poweroffInit(void); /** * @brief Set callback function @@ -65,14 +65,14 @@ int poweroffInit(void); * standart specifications. * */ -void poweroffSetCallback(poweroff_callback cb, void *arg); +extern void poweroffSetCallback(poweroff_callback cb, void *arg); /** * @brief Immidiate console shutdown. * Do not call it without closing all stuff. * */ -void poweroffShutdown(void); +extern void poweroffShutdown(void); /** * @brief Change thread priority @@ -84,7 +84,7 @@ void poweroffShutdown(void); * poweroffInit() ). In that case poweroffSetCallback() will be registered with * the provided priority. */ -void poweroffChangeThreadPriority(int priority); +extern void poweroffChangeThreadPriority(int priority); #ifdef __cplusplus } diff --git a/ee/rpc/remote/include/librm.h b/ee/rpc/remote/include/librm.h index 41f10f7f388..45cfcd4a358 100644 --- a/ee/rpc/remote/include/librm.h +++ b/ee/rpc/remote/include/librm.h @@ -258,13 +258,13 @@ extern "C" { * @brief Initialise librm * @return == 1 => OK */ -int RMMan_Init(void); +extern int RMMan_Init(void); /** * @brief Ends all remote communication * @return == 1 => OK */ -int RMMan_End(void); +extern int RMMan_End(void); /** * @param [in] port Port number to open (0 or 1) @@ -274,7 +274,7 @@ int RMMan_End(void); * Must be a 64-byte aligned address. * @return != 0 => OK */ -int RMMan_Open(int port, int slot, void *pData); +extern int RMMan_Open(int port, int slot, void *pData); /** * @brief Closes an opened port. @@ -283,7 +283,7 @@ int RMMan_Open(int port, int slot, void *pData); * @param slot Slot to close * @return != 0 => OK */ -int RMMan_Close(int port, int slot); +extern int RMMan_Close(int port, int slot); /** * @brief Read remote data @@ -292,12 +292,12 @@ int RMMan_Close(int port, int slot); * @param [out] data A pointer to a 32 byte array where the result is stored * @return != 0 => OK */ -void RMMan_Read(int port, int slot, struct remote_data *data); +extern void RMMan_Read(int port, int slot, struct remote_data *data); /** * @brief Returns the rmman.irx version */ -u32 RMMan_GetModuleVersion(void); +extern u32 RMMan_GetModuleVersion(void); #ifdef _cplusplus } diff --git a/ee/rpc/sior/include/sior_rpc.h b/ee/rpc/sior/include/sior_rpc.h index bad9bd63a7e..13671592809 100644 --- a/ee/rpc/sior/include/sior_rpc.h +++ b/ee/rpc/sior/include/sior_rpc.h @@ -22,7 +22,7 @@ extern "C" { #endif -int SIOR_Init(int priority); +extern int SIOR_Init(int priority); #ifdef __cplusplus } diff --git a/ee/rpc/tcpips/include/ps2ips.h b/ee/rpc/tcpips/include/ps2ips.h index 89ebf2f5a73..59d4853feba 100644 --- a/ee/rpc/tcpips/include/ps2ips.h +++ b/ee/rpc/tcpips/include/ps2ips.h @@ -26,8 +26,8 @@ extern "C" { #endif -int ps2ip_init(void); -void ps2ip_deinit(void); +extern int ps2ip_init(void); +extern void ps2ip_deinit(void); #ifdef __cplusplus } diff --git a/ee/sbv/include/sbv_patches.h b/ee/sbv/include/sbv_patches.h index 4ad0cda79c8..adaaf3b36dd 100644 --- a/ee/sbv/include/sbv_patches.h +++ b/ee/sbv/include/sbv_patches.h @@ -28,7 +28,7 @@ extern "C" { * Newer LOADFILE modules do not have this limitation. * Unlike the official patch, this version is not dependent on 0x01e00000-0x01e80000. */ -int sbv_patch_enable_lmb(void); +extern int sbv_patch_enable_lmb(void); /** * @return 0: success, none-zero: error * @@ -37,7 +37,7 @@ int sbv_patch_enable_lmb(void); * can be loaded from user-writable media like the memory card or HDD unit. * This patch will disable the black/white list, allowing executables to be freely loaded from any device. */ -int sbv_patch_disable_prefix_check(void); +extern int sbv_patch_disable_prefix_check(void); /** * @start address above which all user memory is cleared * @return 0: success, -1: error @@ -47,7 +47,7 @@ int sbv_patch_disable_prefix_check(void); * overwritten. In order to completely disable the memory clear, simply pass * 0x02000000 to it. */ -int sbv_patch_user_mem_clear(void *start); +extern int sbv_patch_user_mem_clear(void *start); /** * @return 0: success, none-zero: error * @@ -56,7 +56,7 @@ int sbv_patch_user_mem_clear(void *start); * which could allow simultaneous access into sceSifSetDma (a critical region). * 2. The RPC dispatcher code for remove() has a missing break, resulting in mkdir() being called after remove() returns. */ -int sbv_patch_fileio(void); +extern int sbv_patch_fileio(void); #ifdef __cplusplus } diff --git a/ee/sbv/include/slib.h b/ee/sbv/include/slib.h index d4ec02c0368..1e1f282f908 100644 --- a/ee/sbv/include/slib.h +++ b/ee/sbv/include/slib.h @@ -57,10 +57,10 @@ extern "C" { * * This routine will need to be called everytime the IOP is reset. */ -slib_exp_lib_list_t *slib_exp_lib_list(); +extern slib_exp_lib_list_t *slib_exp_lib_list(); /** Retrieve an export library by name. */ -int slib_get_exp_lib(const char *name, slib_exp_lib_t *library); +extern int slib_get_exp_lib(const char *name, slib_exp_lib_t *library); #ifdef __cplusplus } diff --git a/ee/sbv/include/smem.h b/ee/sbv/include/smem.h index 57bb0db733c..fd4eb411de6 100644 --- a/ee/sbv/include/smem.h +++ b/ee/sbv/include/smem.h @@ -39,8 +39,8 @@ extern "C" { #endif -u32 smem_read(void *addr, void *buf, u32 size); -u32 smem_write(void *addr, void *buf, u32 size); +extern u32 smem_read(void *addr, void *buf, u32 size); +extern u32 smem_write(void *addr, void *buf, u32 size); #ifdef __cplusplus } diff --git a/ee/sbv/include/smod.h b/ee/sbv/include/smod.h index e040169c137..f8c03ca9729 100644 --- a/ee/sbv/include/smod.h +++ b/ee/sbv/include/smod.h @@ -46,10 +46,10 @@ extern "C" { #endif /** Return the next module referenced in the global module list. */ -int smod_get_next_mod(smod_mod_info_t *cur_mod, smod_mod_info_t *next_mod); +extern int smod_get_next_mod(smod_mod_info_t *cur_mod, smod_mod_info_t *next_mod); /** Find and retreive a module by it's module name. */ -int smod_get_mod_by_name(const char *name, smod_mod_info_t *info); +extern int smod_get_mod_by_name(const char *name, smod_mod_info_t *info); #ifdef __cplusplus } diff --git a/ee/sbv/src/common.h b/ee/sbv/src/common.h index a25f001100c..1c662d72a40 100644 --- a/ee/sbv/src/common.h +++ b/ee/sbv/src/common.h @@ -9,5 +9,5 @@ struct smem_buf { }; }; -int smem_write_word(void *address, u32 value); -int __memcmp(const void *s1, const void *s2, unsigned int length); +extern int smem_write_word(void *address, u32 value); +extern int __memcmp(const void *s1, const void *s2, unsigned int length); diff --git a/iop/cdvd/cdfs/src/cdfs_iop.h b/iop/cdvd/cdfs/src/cdfs_iop.h index 80aeee1403b..b88e024307c 100755 --- a/iop/cdvd/cdfs/src/cdfs_iop.h +++ b/iop/cdvd/cdfs/src/cdfs_iop.h @@ -30,12 +30,12 @@ enum Cdvd_Changed_Index { CHANGED_MAX }; -int cdfs_prepare(void); -int cdfs_start(void); -int cdfs_finish(void); -int cdfs_findfile(const char *fname, struct TocEntry *tocEntry); -int cdfs_readSect(u32 lsn, u32 sectors, u8 *buf); -int cdfs_getDir(const char *pathname, const char *extensions, enum CDFS_getMode getMode, struct TocEntry tocEntry[], unsigned int req_entries); -int cdfs_checkDiskChanged(enum Cdvd_Changed_Index index); +extern int cdfs_prepare(void); +extern int cdfs_start(void); +extern int cdfs_finish(void); +extern int cdfs_findfile(const char *fname, struct TocEntry *tocEntry); +extern int cdfs_readSect(u32 lsn, u32 sectors, u8 *buf); +extern int cdfs_getDir(const char *pathname, const char *extensions, enum CDFS_getMode getMode, struct TocEntry tocEntry[], unsigned int req_entries); +extern int cdfs_checkDiskChanged(enum Cdvd_Changed_Index index); #endif // _CDFS_H diff --git a/iop/debug/iop_sbusdbg/include/iop_sbusdbg.h b/iop/debug/iop_sbusdbg/include/iop_sbusdbg.h index 20a0c335d4d..933e53cadf0 100644 --- a/iop/debug/iop_sbusdbg/include/iop_sbusdbg.h +++ b/iop/debug/iop_sbusdbg/include/iop_sbusdbg.h @@ -9,30 +9,30 @@ #include #include -int iop_dbg_install(void); -int iop_dbg_remove(void); - -u32 iop_dbg_get_dcic(void); -u32 iop_dbg_get_bpc(void); -u32 iop_dbg_get_bpcm(void); -u32 iop_dbg_get_bda(void); -u32 iop_dbg_get_bdam(void); - -void iop_dbg_set_dcic(u32 v); -void iop_dbg_set_bpc(u32 v); -void iop_dbg_set_bpcm(u32 v); -void iop_dbg_set_bda(u32 v); -void iop_dbg_set_bdam(u32 v); - -void iop_dbg_set_bpr(u32 addr, u32 mask, u32 user_mask); -void iop_dbg_set_bpw(u32 addr, u32 mask, u32 user_mask); -void iop_dbg_set_bpx(u32 addr, u32 mask, u32 user_mask); - -void iop_dbg_clear(void); -void iop_dbg_clr_bpda(void); -void iop_dbg_clr_bpx(void); - -void tty_puts(const char *str); -void signal_iop_exception(IOP_RegFrame *frame); +extern int iop_dbg_install(void); +extern int iop_dbg_remove(void); + +extern u32 iop_dbg_get_dcic(void); +extern u32 iop_dbg_get_bpc(void); +extern u32 iop_dbg_get_bpcm(void); +extern u32 iop_dbg_get_bda(void); +extern u32 iop_dbg_get_bdam(void); + +extern void iop_dbg_set_dcic(u32 v); +extern void iop_dbg_set_bpc(u32 v); +extern void iop_dbg_set_bpcm(u32 v); +extern void iop_dbg_set_bda(u32 v); +extern void iop_dbg_set_bdam(u32 v); + +extern void iop_dbg_set_bpr(u32 addr, u32 mask, u32 user_mask); +extern void iop_dbg_set_bpw(u32 addr, u32 mask, u32 user_mask); +extern void iop_dbg_set_bpx(u32 addr, u32 mask, u32 user_mask); + +extern void iop_dbg_clear(void); +extern void iop_dbg_clr_bpda(void); +extern void iop_dbg_clr_bpx(void); + +extern void tty_puts(const char *str); +extern void signal_iop_exception(IOP_RegFrame *frame); #endif /* __IOP_SBUSDBG_H__ */ diff --git a/iop/debug/iop_sbusdbg/src/sbus_tty.h b/iop/debug/iop_sbusdbg/src/sbus_tty.h index 2951d777a99..b7d86c2ef00 100644 --- a/iop/debug/iop_sbusdbg/src/sbus_tty.h +++ b/iop/debug/iop_sbusdbg/src/sbus_tty.h @@ -4,6 +4,6 @@ #include "tamtypes.h" // Prototypes -int sbus_tty_init(void); +extern int sbus_tty_init(void); #endif diff --git a/iop/debug/iopdebug/include/iopdebug.h b/iop/debug/iopdebug/include/iopdebug.h index 6c342bfbf6a..9c7ce989f6e 100644 --- a/iop/debug/iopdebug/include/iopdebug.h +++ b/iop/debug/iopdebug/include/iopdebug.h @@ -24,32 +24,32 @@ typedef void (IOP_ExceptionHandler)(IOP_RegFrame *); -int iop_dbg_install(void); -int iop_dbg_remove(void); -IOP_ExceptionHandler *iop_dbg_get_handler(int cause); -IOP_ExceptionHandler *iop_dbg_set_handler(int cause, IOP_ExceptionHandler *handler); -void iop_dbg_get_reg_frames(IOP_RegFrame **def_frame_ptr, IOP_RegFrame **dbg_frame_ptr); -u32 iop_dbg_get_dcic(void); -void iop_dbg_set_dcic(u32 v); +extern int iop_dbg_install(void); +extern int iop_dbg_remove(void); +extern IOP_ExceptionHandler *iop_dbg_get_handler(int cause); +extern IOP_ExceptionHandler *iop_dbg_set_handler(int cause, IOP_ExceptionHandler *handler); +extern void iop_dbg_get_reg_frames(IOP_RegFrame **def_frame_ptr, IOP_RegFrame **dbg_frame_ptr); +extern u32 iop_dbg_get_dcic(void); +extern void iop_dbg_set_dcic(u32 v); -u32 iop_dbg_get_bpc(void); -void iop_dbg_set_bpc(u32 v); +extern u32 iop_dbg_get_bpc(void); +extern void iop_dbg_set_bpc(u32 v); -u32 iop_dbg_get_bpcm(void); -void iop_dbg_set_bpcm(u32 v); +extern u32 iop_dbg_get_bpcm(void); +extern void iop_dbg_set_bpcm(u32 v); -u32 iop_dbg_get_bda(void); -void iop_dbg_set_bda(u32 v); -u32 iop_dbg_get_bdam(void); -void iop_dbg_set_bdam(u32 v); +extern u32 iop_dbg_get_bda(void); +extern void iop_dbg_set_bda(u32 v); +extern u32 iop_dbg_get_bdam(void); +extern void iop_dbg_set_bdam(u32 v); -void iop_dbg_set_bpr(u32 addr, u32 mask, u32 user_mask); -void iop_dbg_set_bpw(u32 addr, u32 mask, u32 user_mask); -void iop_dbg_set_bpx(u32 addr, u32 mask, u32 user_mask); +extern void iop_dbg_set_bpr(u32 addr, u32 mask, u32 user_mask); +extern void iop_dbg_set_bpw(u32 addr, u32 mask, u32 user_mask); +extern void iop_dbg_set_bpx(u32 addr, u32 mask, u32 user_mask); -void iop_dbg_clr_bps(void); -void iop_dbg_clr_bpda(void); -void iop_dbg_clr_bpx(void); +extern void iop_dbg_clr_bps(void); +extern void iop_dbg_clr_bpda(void); +extern void iop_dbg_clr_bpx(void); #define iopdebug_IMPORTS_start DECLARE_IMPORT_TABLE(iopdebug, 1, 1) #define iopdebug_IMPORTS_end END_IMPORT_TABLE diff --git a/iop/debug/ioptrap/include/ioptrap.h b/iop/debug/ioptrap/include/ioptrap.h index a942fa2cab7..8ac7d31b786 100644 --- a/iop/debug/ioptrap/include/ioptrap.h +++ b/iop/debug/ioptrap/include/ioptrap.h @@ -59,25 +59,25 @@ typedef void (*trap_exception_handler_t)(exception_type_t, exception_frame_t *); #define DCIC_DA (1 << 25) #define DCIC_PC (1 << 24) -const char *get_exception_name(exception_type_t type); +extern const char *get_exception_name(exception_type_t type); /* Will act as a setjmp. Returns 0 to say it was the first call, otherwise, returns the exception number. (note that you'll never get any interrupt...) Note that using this will completely disable user defined exception handlers. */ -exception_type_t dbg_setjmp(); +extern exception_type_t dbg_setjmp(); /* Will return the old handler. */ -trap_exception_handler_t set_exception_handler(exception_type_t type, trap_exception_handler_t handler); -trap_exception_handler_t get_exception_handler(exception_type_t type); +extern trap_exception_handler_t set_exception_handler(exception_type_t type, trap_exception_handler_t handler); +extern trap_exception_handler_t get_exception_handler(exception_type_t type); /* Breakpoint stuff. */ -void set_dba(u32 v); -void set_dbam(u32 v); -void set_dcic(u32 v); -u32 get_dba(); -u32 get_dbam(); -u32 get_dcic(); +extern void set_dba(u32 v); +extern void set_dbam(u32 v); +extern void set_dcic(u32 v); +extern u32 get_dba(); +extern u32 get_dbam(); +extern u32 get_dcic(); #define ioptrap_IMPORTS_start DECLARE_IMPORT_TABLE(ioptrap, 1, 1) #define ioptrap_IMPORTS_end END_IMPORT_TABLE diff --git a/iop/debug/ppctty/src/tty.h b/iop/debug/ppctty/src/tty.h index 9206e79f317..c7470a557be 100644 --- a/iop/debug/ppctty/src/tty.h +++ b/iop/debug/ppctty/src/tty.h @@ -5,6 +5,6 @@ #include #define MODNAME "ppctty" // Prototypes -int tty_init(void); +extern int tty_init(void); #endif diff --git a/iop/debug/sior/src/xprintf.h b/iop/debug/sior/src/xprintf.h index 3847eb2b5d1..48ae2f9692d 100644 --- a/iop/debug/sior/src/xprintf.h +++ b/iop/debug/sior/src/xprintf.h @@ -22,19 +22,19 @@ #define F_vsnprintf #ifdef F_sprintf -int sprintf(char *str, const char *format, ...); +extern int sprintf(char *str, const char *format, ...); #endif #ifdef F_snprintf -int snprintf(char *str, size_t sz, const char *format, ...); +extern int snprintf(char *str, size_t sz, const char *format, ...); #endif #ifdef F_vsprintf -int vsprintf(char *buf, const char *fmt, va_list ap); +extern int vsprintf(char *buf, const char *fmt, va_list ap); #endif #ifdef F_vsnprintf -int vsnprintf(char *buf, size_t n, const char *fmt, va_list ap); +extern int vsnprintf(char *buf, size_t n, const char *fmt, va_list ap); #endif #endif /* _XPRINTF_H_ */ diff --git a/iop/dev9/atad/include/atad.h b/iop/dev9/atad/include/atad.h index 2aef112a230..e5a3d998d84 100644 --- a/iop/dev9/atad/include/atad.h +++ b/iop/dev9/atad/include/atad.h @@ -49,30 +49,30 @@ typedef struct _ata_devinfo #define ATA_RES_ERR_LOCKED -509 #define ATA_RES_ERR_ICRC -510 -ata_devinfo_t *sceAtaInit(int device); +extern ata_devinfo_t *sceAtaInit(int device); -int sceAtaSoftReset(void); +extern int sceAtaSoftReset(void); -int sceAtaExecCmd(void *buf, u32 blkcount, u16 feature, u16 nsector, u16 sector, u16 lcyl, u16 hcyl, u16 select, u16 command); -int sceAtaWaitResult(void); +extern int sceAtaExecCmd(void *buf, u32 blkcount, u16 feature, u16 nsector, u16 sector, u16 lcyl, u16 hcyl, u16 select, u16 command); +extern int sceAtaWaitResult(void); -int sceAtaGetError(void); +extern int sceAtaGetError(void); -int sceAtaDmaTransfer(int device, void *buf, u32 lba, u32 nsectors, int dir); +extern int sceAtaDmaTransfer(int device, void *buf, u32 lba, u32 nsectors, int dir); // DRM functions that were meant to keep users from sharing disks (and hence the contained content). Supported by only Sony-modified HDDs (e.g. the SCPH-20400). -int sceAtaSecuritySetPassword(int device, void *password); -int sceAtaSecurityUnLock(int device, void *password); -int sceAtaSecurityEraseUnit(int device); - -int sceAtaIdle(int device, int period); -int sceAtaGetSceId(int device, void *data); -int sceAtaSmartReturnStatus(int device); -int sceAtaSmartSaveAttr(int device); -int sceAtaFlushCache(int device); -int sceAtaIdleImmediate(int device); - -int ata_device_sector_io64(int device, void *buf, u64 lba, u32 nsectors, int dir); +extern int sceAtaSecuritySetPassword(int device, void *password); +extern int sceAtaSecurityUnLock(int device, void *password); +extern int sceAtaSecurityEraseUnit(int device); + +extern int sceAtaIdle(int device, int period); +extern int sceAtaGetSceId(int device, void *data); +extern int sceAtaSmartReturnStatus(int device); +extern int sceAtaSmartSaveAttr(int device); +extern int sceAtaFlushCache(int device); +extern int sceAtaIdleImmediate(int device); + +extern int ata_device_sector_io64(int device, void *buf, u64 lba, u32 nsectors, int dir); #define atad_IMPORTS_start DECLARE_IMPORT_TABLE(atad, 1, 3) #define atad_IMPORTS_end END_IMPORT_TABLE diff --git a/iop/dev9/dev9/include/dev9.h b/iop/dev9/dev9/include/dev9.h index 91b2725f9b7..9a059ab77c8 100644 --- a/iop/dev9/dev9/include/dev9.h +++ b/iop/dev9/dev9/include/dev9.h @@ -25,25 +25,25 @@ typedef int (*dev9_intr_cb_t)(int flag); typedef void (*dev9_shutdown_cb_t)(void); typedef void (*dev9_dma_cb_t)(int bcr, int dir); -void SpdRegisterIntrHandler(int intr, dev9_intr_cb_t cb); +extern void SpdRegisterIntrHandler(int intr, dev9_intr_cb_t cb); -int SpdDmaTransfer(int ctrl, void *buf, int bcr, int dir); +extern int SpdDmaTransfer(int ctrl, void *buf, int bcr, int dir); -void Dev9CardStop(void); -void SpdIntrEnable(int mask); -void SpdIntrDisable(int mask); +extern void Dev9CardStop(void); +extern void SpdIntrEnable(int mask); +extern void SpdIntrDisable(int mask); -int SpdGetEthernetID(u16 *buf); +extern int SpdGetEthernetID(u16 *buf); -void SpdSetLED(int ctl); -void dev9LED2Ctl(int ctl); -void dev9ControlPIO3(int ctl); +extern void SpdSetLED(int ctl); +extern void dev9LED2Ctl(int ctl); +extern void dev9ControlPIO3(int ctl); -int Dev9RegisterPowerOffHandler(int idx, dev9_shutdown_cb_t cb); +extern int Dev9RegisterPowerOffHandler(int idx, dev9_shutdown_cb_t cb); -void dev9RegisterPreDmaCb(int ctrl, dev9_dma_cb_t cb); +extern void dev9RegisterPreDmaCb(int ctrl, dev9_dma_cb_t cb); -void dev9RegisterPostDmaCb(int ctrl, dev9_dma_cb_t cb); +extern void dev9RegisterPostDmaCb(int ctrl, dev9_dma_cb_t cb); #define dev9_IMPORTS_start DECLARE_IMPORT_TABLE(dev9, 1, 9) #define dev9_IMPORTS_end END_IMPORT_TABLE diff --git a/iop/dev9/poweroff/include/poweroff.h b/iop/dev9/poweroff/include/poweroff.h index e74620bd656..7a800c5fb20 100644 --- a/iop/dev9/poweroff/include/poweroff.h +++ b/iop/dev9/poweroff/include/poweroff.h @@ -20,10 +20,10 @@ typedef void (*pwoffcb)(void*); -void SetPowerButtonHandler(pwoffcb func, void* param); -void AddPowerOffHandler(pwoffcb func, void* param); -void RemovePowerOffHandler(pwoffcb func); -void PoweroffShutdown(); +extern void SetPowerButtonHandler(pwoffcb func, void* param); +extern void AddPowerOffHandler(pwoffcb func, void* param); +extern void RemovePowerOffHandler(pwoffcb func); +extern void PoweroffShutdown(); #define poweroff_IMPORTS_start DECLARE_IMPORT_TABLE(poweroff, 1, 1) #define poweroff_IMPORTS_end END_IMPORT_TABLE diff --git a/iop/fs/bdm/include/bdm.h b/iop/fs/bdm/include/bdm.h index c70120b8a5d..11b5ee27367 100644 --- a/iop/fs/bdm/include/bdm.h +++ b/iop/fs/bdm/include/bdm.h @@ -57,12 +57,12 @@ struct file_system typedef void (*bdm_cb)(int event); // Exported functions -void bdm_connect_bd(struct block_device *bd); -void bdm_disconnect_bd(struct block_device *bd); -void bdm_connect_fs(struct file_system *fs); -void bdm_disconnect_fs(struct file_system *fs); -void bdm_get_bd(struct block_device **pbd, unsigned int count); -void bdm_RegisterCallback(bdm_cb cb); +extern void bdm_connect_bd(struct block_device *bd); +extern void bdm_disconnect_bd(struct block_device *bd); +extern void bdm_connect_fs(struct file_system *fs); +extern void bdm_disconnect_fs(struct file_system *fs); +extern void bdm_get_bd(struct block_device **pbd, unsigned int count); +extern void bdm_RegisterCallback(bdm_cb cb); #define bdm_IMPORTS_start DECLARE_IMPORT_TABLE(bdm, 1, 1) #define bdm_IMPORTS_end END_IMPORT_TABLE diff --git a/iop/fs/bdm/src/include/part_driver.h b/iop/fs/bdm/src/include/part_driver.h index ace26e2d662..760fa86d7ce 100644 --- a/iop/fs/bdm/src/include/part_driver.h +++ b/iop/fs/bdm/src/include/part_driver.h @@ -26,9 +26,9 @@ struct partition extern struct partition g_part[MAX_PARTITIONS]; extern struct block_device g_part_bd[MAX_PARTITIONS]; -int GetNextFreePartitionIndex(); +extern int GetNextFreePartitionIndex(); -int part_connect_mbr(struct block_device *bd); -int part_connect_gpt(struct block_device *bd); +extern int part_connect_mbr(struct block_device *bd); +extern int part_connect_gpt(struct block_device *bd); #endif \ No newline at end of file diff --git a/iop/fs/devfs/include/devfs.h b/iop/fs/devfs/include/devfs.h index 31aef8be6d5..41fac33751e 100644 --- a/iop/fs/devfs/include/devfs.h +++ b/iop/fs/devfs/include/devfs.h @@ -123,14 +123,14 @@ typedef struct * @returns A device handle is returned if the device was added. * On error INVALID_HDEV is returned */ -HDEV DevFSAddDevice(const devfs_node_t *node); +extern HDEV DevFSAddDevice(const devfs_node_t *node); /** Define to add DevFSAddDevice to the imports list */ /** Deletes an previously opened device. * @param hDev: Handle to the device to delete * @returns 0 if device deleted, -1 on error */ -int DevFSDelDevice(HDEV hDev); +extern int DevFSDelDevice(HDEV hDev); /** Adds a sub device to a previously opened device * @param hDev: Handle to an opened device @@ -139,14 +139,14 @@ int DevFSDelDevice(HDEV hDev); * @param data: Pointer to some private data to associate with this sub device * @returns 0 if sub device added, else -1 */ -int DevFSAddSubDevice(HDEV hDev, u32 subdev_no, s32 mode, devfs_loc_t extent, void *data); +extern int DevFSAddSubDevice(HDEV hDev, u32 subdev_no, s32 mode, devfs_loc_t extent, void *data); /** Deletes a sub device. * @param hDev: Handle to an opened device. * @param subdev_no: The number of the subdevice to delete. * @returns 0 if device deleted. -1 on error. */ -int DevFSDelSubDevice(HDEV hDev, u32 subdev_no); +extern int DevFSDelSubDevice(HDEV hDev, u32 subdev_no); /** Defines an invalid HDEV value */ #define INVALID_HDEV -1 diff --git a/iop/fs/libbdm/include/bd_cache.h b/iop/fs/libbdm/include/bd_cache.h index f403a28b44f..8f556d1760c 100644 --- a/iop/fs/libbdm/include/bd_cache.h +++ b/iop/fs/libbdm/include/bd_cache.h @@ -21,10 +21,10 @@ /* Create a new cached block device */ -struct block_device *bd_cache_create(struct block_device *bd); +extern struct block_device *bd_cache_create(struct block_device *bd); /* Destroy a cached block device */ -void bd_cache_destroy(struct block_device *cbd); +extern void bd_cache_destroy(struct block_device *cbd); #endif diff --git a/iop/fs/libbdm/include/bd_defrag.h b/iop/fs/libbdm/include/bd_defrag.h index 255017cc565..a10d4f1212b 100644 --- a/iop/fs/libbdm/include/bd_defrag.h +++ b/iop/fs/libbdm/include/bd_defrag.h @@ -21,8 +21,8 @@ #include -int bd_defrag_read(struct block_device* bd, u32 fragcount, struct bd_fragment* fraglist, u64 sector, void* buffer, u16 count); -int bd_defrag_write(struct block_device* bd, u32 fragcount, struct bd_fragment* fraglist, u64 sector, const void* buffer, u16 count); +extern int bd_defrag_read(struct block_device* bd, u32 fragcount, struct bd_fragment* fraglist, u64 sector, void* buffer, u16 count); +extern int bd_defrag_write(struct block_device* bd, u32 fragcount, struct bd_fragment* fraglist, u64 sector, const void* buffer, u16 count); // For backwards compatibility: #define bd_defrag bd_defrag_read diff --git a/iop/fs/netfs/src/devscan.h b/iop/fs/netfs/src/devscan.h index 9e7568028fc..2db890d03e3 100644 --- a/iop/fs/netfs/src/devscan.h +++ b/iop/fs/netfs/src/devscan.h @@ -34,7 +34,7 @@ typedef struct { int len; } dev_table_t; -int devscan_gettype(char *name); -int devscan_setup(int devtype); -int devscan_getdevlist(char *buffer); -ModuleInfo_t *devscan_getmodule(const char *name); +extern int devscan_gettype(char *name); +extern int devscan_setup(int devtype); +extern int devscan_getdevlist(char *buffer); +extern ModuleInfo_t *devscan_getmodule(const char *name); diff --git a/iop/fs/netfs/src/ps2_fio.h b/iop/fs/netfs/src/ps2_fio.h index b7c7ebb1c47..3e2ac6407a3 100644 --- a/iop/fs/netfs/src/ps2_fio.h +++ b/iop/fs/netfs/src/ps2_fio.h @@ -19,7 +19,7 @@ // set this to enable it #define PS2FIOINC -int ps2netfs_Init( ); -int ps2netfs_Destroy(void); +extern int ps2netfs_Init( ); +extern int ps2netfs_Destroy(void); #endif diff --git a/iop/fs/vfat/src/include/fat.h b/iop/fs/vfat/src/include/fat.h index e8cc9d9c8b5..fae9ce4732d 100644 --- a/iop/fs/vfat/src/include/fat.h +++ b/iop/fs/vfat/src/include/fat.h @@ -151,10 +151,10 @@ static USBHD_INLINE unsigned int fat_cluster2sector(fat_bpb *partBpb, unsigned i return partBpb->dataStart + (partBpb->clusterSize * (cluster - 2)); } -unsigned int fat_getClusterRecord12(const unsigned char *buf, int type); -int fat_getDirentry(unsigned char fatType, fat_direntry *dir_entry, fat_direntry_summary *dir); -int fat_getDirentrySectorData(fat_driver *fatd, unsigned int *startCluster, unsigned int *startSector, unsigned int *dirSector); -void fat_invalidateLastChainResult(fat_driver *fatd); -void fat_getClusterAtFilePos(fat_driver *fatd, fat_dir *fatDir, unsigned int filePos, unsigned int *cluster, unsigned int *clusterPos); +extern unsigned int fat_getClusterRecord12(const unsigned char *buf, int type); +extern int fat_getDirentry(unsigned char fatType, fat_direntry *dir_entry, fat_direntry_summary *dir); +extern int fat_getDirentrySectorData(fat_driver *fatd, unsigned int *startCluster, unsigned int *startSector, unsigned int *dirSector); +extern void fat_invalidateLastChainResult(fat_driver *fatd); +extern void fat_getClusterAtFilePos(fat_driver *fatd, fat_dir *fatDir, unsigned int filePos, unsigned int *cluster, unsigned int *clusterPos); #endif /* _FAT_H */ diff --git a/iop/fs/vfat/src/include/fat_driver.h b/iop/fs/vfat/src/include/fat_driver.h index eb5f2860250..8be083bc51a 100644 --- a/iop/fs/vfat/src/include/fat_driver.h +++ b/iop/fs/vfat/src/include/fat_driver.h @@ -105,38 +105,38 @@ typedef struct _fat_dir } fat_dir; #ifdef BUILDING_IEEE1394_DISK -int InitFAT(void); +extern int InitFAT(void); #endif /* BUILDING_IEEE1394_DISK */ -int strEqual(const char *s1, const char *s2); +extern int strEqual(const char *s1, const char *s2); #ifdef BUILDING_USBHDFSD -int fat_mount(mass_dev *dev, unsigned int start, unsigned int count); -void fat_forceUnmount(mass_dev *dev); +extern int fat_mount(mass_dev *dev, unsigned int start, unsigned int count); +extern void fat_forceUnmount(mass_dev *dev); #endif /* BUILDING_USBHDFSD */ #ifdef BUILDING_IEEE1394_DISK -int fat_mount(struct SBP2Device *dev, unsigned int start, unsigned int count); -void fat_forceUnmount(struct SBP2Device *dev); +extern int fat_mount(struct SBP2Device *dev, unsigned int start, unsigned int count); +extern void fat_forceUnmount(struct SBP2Device *dev); #endif /* BUILDING_IEEE1394_DISK */ #if !defined(BUILDING_IEEE1394_DISK) && !defined(BUILDING_USBHDFSD) -int fat_mount(struct block_device *bd); -void fat_forceUnmount(struct block_device *bd); +extern int fat_mount(struct block_device *bd); +extern void fat_forceUnmount(struct block_device *bd); #endif -void fat_setFatDirChain(fat_driver *fatd, fat_dir *fatDir); -int fat_readFile(fat_driver *fatd, fat_dir *fatDir, unsigned int filePos, unsigned char *buffer, unsigned int size); -int fat_getFirstDirentry(fat_driver *fatd, const char *dirName, fat_dir_list *fatdlist, fat_dir *fatDir_host, fat_dir *fatDir); -int fat_getNextDirentry(fat_driver *fatd, fat_dir_list *fatdlist, fat_dir *fatDir); +extern void fat_setFatDirChain(fat_driver *fatd, fat_dir *fatDir); +extern int fat_readFile(fat_driver *fatd, fat_dir *fatDir, unsigned int filePos, unsigned char *buffer, unsigned int size); +extern int fat_getFirstDirentry(fat_driver *fatd, const char *dirName, fat_dir_list *fatdlist, fat_dir *fatDir_host, fat_dir *fatDir); +extern int fat_getNextDirentry(fat_driver *fatd, fat_dir_list *fatdlist, fat_dir *fatDir); -fat_driver *fat_getData(int device); -int fat_getFileStartCluster(fat_driver *fatd, const char *fname, unsigned int *startCluster, fat_dir *fatDir); -int fat_getClusterChain(fat_driver *fatd, unsigned int cluster, unsigned int *buf, unsigned int bufSize, int startFlag); +extern fat_driver *fat_getData(int device); +extern int fat_getFileStartCluster(fat_driver *fatd, const char *fname, unsigned int *startCluster, fat_dir *fatDir); +extern int fat_getClusterChain(fat_driver *fatd, unsigned int cluster, unsigned int *buf, unsigned int bufSize, int startFlag); #ifndef BUILDING_IEEE1394_DISK -int fat_CheckChain(fat_driver *fatd, unsigned int cluster); +extern int fat_CheckChain(fat_driver *fatd, unsigned int cluster); #endif /* BUILDING_USBHDFSD */ #if !defined(BUILDING_IEEE1394_DISK) && !defined(BUILDING_USBHDFSD) -int fat_stopUnit(int device); -void fat_stopAll(void); +extern int fat_stopUnit(int device); +extern void fat_stopAll(void); #endif #endif diff --git a/iop/fs/vfat/src/include/fat_write.h b/iop/fs/vfat/src/include/fat_write.h index 3a888b358de..74b0e5fcd83 100644 --- a/iop/fs/vfat/src/include/fat_write.h +++ b/iop/fs/vfat/src/include/fat_write.h @@ -1,14 +1,14 @@ #ifndef _FAT_WRITE_H #define _FAT_WRITE_H 1 -int fat_createFile(fat_driver *fatd, const char *fname, char directory, char escapeNotExist, unsigned int *cluster, unsigned int *sfnSector, int *sfnOffset); -int fat_deleteFile(fat_driver *fatd, const char *fname, char directory); -int fat_truncateFile(fat_driver *fatd, unsigned int cluster, unsigned int sfnSector, int sfnOffset); -int fat_renameFile(fat_driver *fatd, fat_dir *fatdir, const char *fname); -int fat_writeFile(fat_driver *fatd, fat_dir *fatDir, int *updateClusterIndices, unsigned int filePos, unsigned char *buffer, int size); -int fat_updateSfn(fat_driver *fatd, int size, unsigned int sfnSector, int sfnOffset); +extern int fat_createFile(fat_driver *fatd, const char *fname, char directory, char escapeNotExist, unsigned int *cluster, unsigned int *sfnSector, int *sfnOffset); +extern int fat_deleteFile(fat_driver *fatd, const char *fname, char directory); +extern int fat_truncateFile(fat_driver *fatd, unsigned int cluster, unsigned int sfnSector, int sfnOffset); +extern int fat_renameFile(fat_driver *fatd, fat_dir *fatdir, const char *fname); +extern int fat_writeFile(fat_driver *fatd, fat_dir *fatDir, int *updateClusterIndices, unsigned int filePos, unsigned char *buffer, int size); +extern int fat_updateSfn(fat_driver *fatd, int size, unsigned int sfnSector, int sfnOffset); -int fat_allocSector(fat_driver *fatd, unsigned int sector, unsigned char **buf); -int fat_writeSector(fat_driver *fatd, unsigned int sector); -int fat_flushSectors(fat_driver *fatd); +extern int fat_allocSector(fat_driver *fatd, unsigned int sector, unsigned char **buf); +extern int fat_writeSector(fat_driver *fatd, unsigned int sector); +extern int fat_flushSectors(fat_driver *fatd); #endif /* _FAT_WRITE_H */ diff --git a/iop/fs/vfat/src/include/part_driver.h b/iop/fs/vfat/src/include/part_driver.h index ff846d51809..cc5e7090a3d 100644 --- a/iop/fs/vfat/src/include/part_driver.h +++ b/iop/fs/vfat/src/include/part_driver.h @@ -2,12 +2,12 @@ #define _PART_DRIVER_H 1 #ifdef BUILDING_USBHDFSD -int part_connect(mass_dev *dev); -void part_disconnect(mass_dev *dev); +extern int part_connect(mass_dev *dev); +extern void part_disconnect(mass_dev *dev); #endif /* BUILDING_USBHDFSD */ #ifdef BUILDING_IEEE1394_DISK -int part_connect(struct SBP2Device *dev); -void part_disconnect(struct SBP2Device *dev); +extern int part_connect(struct SBP2Device *dev); +extern void part_disconnect(struct SBP2Device *dev); #endif /* BUILDING_IEEE1394_DISK */ #endif diff --git a/iop/fs/vfat/src/include/scache.h b/iop/fs/vfat/src/include/scache.h index 7704847e46b..0cd63bbbda6 100644 --- a/iop/fs/vfat/src/include/scache.h +++ b/iop/fs/vfat/src/include/scache.h @@ -43,25 +43,25 @@ typedef struct _cache_set } cache_set; #endif /* BUILDING_USBHDFSD */ #if defined(BUILDING_USBHDFSD) -cache_set *scache_init(mass_dev *dev, int sectorSize); +extern cache_set *scache_init(mass_dev *dev, int sectorSize); #elif defined(BUILDING_IEEE1394_DISK) -cache_set *scache_init(struct SBP2Device *dev, int sectorSize); +extern cache_set *scache_init(struct SBP2Device *dev, int sectorSize); #else -cache_set *scache_init(struct block_device *bd); +extern cache_set *scache_init(struct block_device *bd); #endif -void scache_close(cache_set *cache); -void scache_kill(cache_set *cache); // dlanor: added for disconnection events (flush impossible) +extern void scache_close(cache_set *cache); +extern void scache_kill(cache_set *cache); // dlanor: added for disconnection events (flush impossible) #if 0 -int scache_allocSector(cache_set *cache, unsigned int sector, void **buf); +extern int scache_allocSector(cache_set *cache, unsigned int sector, void **buf); #endif -int scache_readSector(cache_set *cache, unsigned int sector, void **buf); -int scache_writeSector(cache_set *cache, unsigned int sector); -int scache_flushSectors(cache_set *cache); +extern int scache_readSector(cache_set *cache, unsigned int sector, void **buf); +extern int scache_writeSector(cache_set *cache, unsigned int sector); +extern int scache_flushSectors(cache_set *cache); #ifdef BUILDING_USBHDFSD -void scache_invalidate(cache_set *cache, unsigned int sector, int count); +extern void scache_invalidate(cache_set *cache, unsigned int sector, int count); #endif /* BUILDING_USBHDFSD */ -void scache_getStat(cache_set *cache, unsigned int *access, unsigned int *hits); +extern void scache_getStat(cache_set *cache, unsigned int *access, unsigned int *hits); #endif diff --git a/iop/fs/vfat/src/include/usbhd_common.h b/iop/fs/vfat/src/include/usbhd_common.h index 45f65d7f51c..dd7d323241c 100644 --- a/iop/fs/vfat/src/include/usbhd_common.h +++ b/iop/fs/vfat/src/include/usbhd_common.h @@ -6,8 +6,8 @@ typedef unsigned char u8; #else #define USBHD_INLINE inline -void *malloc(int size); -void free(void *ptr); +extern void *malloc(int size); +extern void free(void *ptr); #endif #ifdef BUILDING_IEEE1394_DISK diff --git a/iop/hdd/apa/src/hdd.h b/iop/hdd/apa/src/hdd.h index 23aecc162a9..95f063fd959 100644 --- a/iop/hdd/apa/src/hdd.h +++ b/iop/hdd/apa/src/hdd.h @@ -25,7 +25,7 @@ typedef struct /////////////////////////////////////////////////////////////////////////////// // Function declarations -int hddCheckPartitionMax(s32 device, u32 size); -apa_cache_t *hddAddPartitionHere(s32 device, const apa_params_t *params, u32 *EmptyBlocks, u32 sector, int *err); +extern int hddCheckPartitionMax(s32 device, u32 size); +extern apa_cache_t *hddAddPartitionHere(s32 device, const apa_params_t *params, u32 *EmptyBlocks, u32 sector, int *err); #endif diff --git a/iop/hdd/apa/src/hdd_fio.h b/iop/hdd/apa/src/hdd_fio.h index 93148331466..3a8992dfbe1 100644 --- a/iop/hdd/apa/src/hdd_fio.h +++ b/iop/hdd/apa/src/hdd_fio.h @@ -12,24 +12,24 @@ #define _HDD_FIO_H // I/O functions -int hddInit(iomanX_iop_device_t *f); -int hddDeinit(iomanX_iop_device_t *f); -int hddFormat(iomanX_iop_file_t *f, const char *dev, const char *blockdev, void *arg, int arglen); -int hddOpen(iomanX_iop_file_t *f, const char *name, int flags, int mode); -int hddClose(iomanX_iop_file_t *f); -int hddRead(iomanX_iop_file_t *f, void *buf, int size); -int hddWrite(iomanX_iop_file_t *f, void *buf, int size); -int hddLseek(iomanX_iop_file_t *f, int post, int whence); -int hddIoctl2(iomanX_iop_file_t *f, int request, void *argp, unsigned int arglen, void *bufp, unsigned int buflen); -int hddRemove(iomanX_iop_file_t *f, const char *name); -int hddDopen(iomanX_iop_file_t *f, const char *name); -int hddDread(iomanX_iop_file_t *f, iox_dirent_t *dirent); -int hddGetStat(iomanX_iop_file_t *f, const char *name, iox_stat_t *stat); -int hddReName(iomanX_iop_file_t *f, const char *oldname, const char *newname); -int hddDevctl(iomanX_iop_file_t *f, const char *devname, int cmd, void *arg, unsigned int arglen, void *bufp, unsigned int buflen); +extern int hddInit(iomanX_iop_device_t *f); +extern int hddDeinit(iomanX_iop_device_t *f); +extern int hddFormat(iomanX_iop_file_t *f, const char *dev, const char *blockdev, void *arg, int arglen); +extern int hddOpen(iomanX_iop_file_t *f, const char *name, int flags, int mode); +extern int hddClose(iomanX_iop_file_t *f); +extern int hddRead(iomanX_iop_file_t *f, void *buf, int size); +extern int hddWrite(iomanX_iop_file_t *f, void *buf, int size); +extern int hddLseek(iomanX_iop_file_t *f, int post, int whence); +extern int hddIoctl2(iomanX_iop_file_t *f, int request, void *argp, unsigned int arglen, void *bufp, unsigned int buflen); +extern int hddRemove(iomanX_iop_file_t *f, const char *name); +extern int hddDopen(iomanX_iop_file_t *f, const char *name); +extern int hddDread(iomanX_iop_file_t *f, iox_dirent_t *dirent); +extern int hddGetStat(iomanX_iop_file_t *f, const char *name, iox_stat_t *stat); +extern int hddReName(iomanX_iop_file_t *f, const char *oldname, const char *newname); +extern int hddDevctl(iomanX_iop_file_t *f, const char *devname, int cmd, void *arg, unsigned int arglen, void *bufp, unsigned int buflen); #ifdef APA_USE_IOMANX -int hddMount(iomanX_iop_file_t *f, const char *fsname, const char *devname, int flag, void *arg, int arglen); -int hddUmount(iomanX_iop_file_t *f, const char *fsname); +extern int hddMount(iomanX_iop_file_t *f, const char *fsname, const char *devname, int flag, void *arg, int arglen); +extern int hddUmount(iomanX_iop_file_t *f, const char *fsname); #else #define hddMount NOT_SUPPORTED #define hddUmount NOT_SUPPORTED diff --git a/iop/hdd/hdsk/src/hdl.h b/iop/hdd/hdsk/src/hdl.h index 8bcd11b2160..4acea15dcd9 100644 --- a/iop/hdd/hdsk/src/hdl.h +++ b/iop/hdd/hdsk/src/hdl.h @@ -13,6 +13,6 @@ #define APA_TYPE_HDLFS 0x1337 -int hdlUpdateGameSliceInfo(int device, u32 main, int part, u32 OldPartStart, u32 NewPartStart); +extern int hdlUpdateGameSliceInfo(int device, u32 main, int part, u32 OldPartStart, u32 NewPartStart); #endif diff --git a/iop/hdd/libapa/include/libapa.h b/iop/hdd/libapa/include/libapa.h index e3ea91e34b4..f3bce8e22e5 100644 --- a/iop/hdd/libapa/include/libapa.h +++ b/iop/hdd/libapa/include/libapa.h @@ -144,39 +144,39 @@ typedef struct u32 number; } apa_params_t; -void apaSaveError(s32 device, void *buffer, u32 lba, u32 err_lba); -void apaSetPartErrorSector(s32 device, u32 lba); -int apaGetPartErrorSector(s32 device, u32 lba, u32 *lba_out); -int apaGetPartErrorName(s32 device, char *name); - -apa_cache_t *apaFillHeader(s32 device, const apa_params_t *params, u32 start, u32 next, u32 prev, u32 length, int *err); -apa_cache_t *apaInsertPartition(s32 device, const apa_params_t *params, u32 sector, int *err); -apa_cache_t *apaFindPartition(s32 device, const char *id, int *err); -void apaAddEmptyBlock(apa_header_t *header, u32 *emptyBlocks); -apa_cache_t *apaRemovePartition(s32 device, u32 start, u32 next, u32 prev, u32 length); -void apaMakeEmpty(apa_cache_t *clink); -apa_cache_t *apaDeleteFixPrev(apa_cache_t *clink1, int *err); -apa_cache_t *apaDeleteFixNext(apa_cache_t *clink, int *err); -int apaDelete(apa_cache_t *clink); -int apaCheckSum(apa_header_t *header, int fullcheck); -int apaReadHeader(s32 device, apa_header_t *header, u32 lba); -int apaWriteHeader(s32 device, apa_header_t *header, u32 lba); -int apaGetFormat(s32 device, int *format); -u32 apaGetPartitionMax(u32 totalLBA); -apa_cache_t *apaGetNextHeader(apa_cache_t *clink, int *err); +extern void apaSaveError(s32 device, void *buffer, u32 lba, u32 err_lba); +extern void apaSetPartErrorSector(s32 device, u32 lba); +extern int apaGetPartErrorSector(s32 device, u32 lba, u32 *lba_out); +extern int apaGetPartErrorName(s32 device, char *name); + +extern apa_cache_t *apaFillHeader(s32 device, const apa_params_t *params, u32 start, u32 next, u32 prev, u32 length, int *err); +extern apa_cache_t *apaInsertPartition(s32 device, const apa_params_t *params, u32 sector, int *err); +extern apa_cache_t *apaFindPartition(s32 device, const char *id, int *err); +extern void apaAddEmptyBlock(apa_header_t *header, u32 *emptyBlocks); +extern apa_cache_t *apaRemovePartition(s32 device, u32 start, u32 next, u32 prev, u32 length); +extern void apaMakeEmpty(apa_cache_t *clink); +extern apa_cache_t *apaDeleteFixPrev(apa_cache_t *clink1, int *err); +extern apa_cache_t *apaDeleteFixNext(apa_cache_t *clink, int *err); +extern int apaDelete(apa_cache_t *clink); +extern int apaCheckSum(apa_header_t *header, int fullcheck); +extern int apaReadHeader(s32 device, apa_header_t *header, u32 lba); +extern int apaWriteHeader(s32 device, apa_header_t *header, u32 lba); +extern int apaGetFormat(s32 device, int *format); +extern u32 apaGetPartitionMax(u32 totalLBA); +extern apa_cache_t *apaGetNextHeader(apa_cache_t *clink, int *err); /////////////////////////////////////////////////////////////////////////////// -int apaCacheInit(u32 size); -int apaCacheDeinit(void); -void apaCacheLink(apa_cache_t *clink, apa_cache_t *cnew); -apa_cache_t *apaCacheUnLink(apa_cache_t *clink); -int apaCacheTransfer(apa_cache_t *clink, int type); -void apaCacheFlushDirty(apa_cache_t *clink); -int apaCacheFlushAllDirty(s32 device); -apa_cache_t *apaCacheGetHeader(s32 device, u32 sector, u32 mode, int *err); -void apaCacheFree(apa_cache_t *clink); -apa_cache_t *apaCacheAlloc(void); +extern int apaCacheInit(u32 size); +extern int apaCacheDeinit(void); +extern void apaCacheLink(apa_cache_t *clink, apa_cache_t *cnew); +extern apa_cache_t *apaCacheUnLink(apa_cache_t *clink); +extern int apaCacheTransfer(apa_cache_t *clink, int type); +extern void apaCacheFlushDirty(apa_cache_t *clink); +extern int apaCacheFlushAllDirty(s32 device); +extern apa_cache_t *apaCacheGetHeader(s32 device, u32 sector, u32 mode, int *err); +extern void apaCacheFree(apa_cache_t *clink); +extern apa_cache_t *apaCacheAlloc(void); /////////////////////////////////////////////////////////////////////////////// @@ -189,21 +189,21 @@ typedef struct } apa_journal_t; #define journalCheckSum(header) apaCheckSum((apa_header_t *)header, 1) -int apaJournalReset(s32 device); -int apaJournalFlush(s32 device); -int apaJournalWrite(apa_cache_t *clink); -int apaJournalRestore(s32 device); +extern int apaJournalReset(s32 device); +extern int apaJournalFlush(s32 device); +extern int apaJournalWrite(apa_cache_t *clink); +extern int apaJournalRestore(s32 device); /////////////////////////////////////////////////////////////////////////////// -void *apaAllocMem(int size); -void apaFreeMem(void *ptr); -int apaGetTime(apa_ps2time_t *tm); -int apaGetIlinkID(u8 *idbuf); +extern void *apaAllocMem(int size); +extern void apaFreeMem(void *ptr); +extern int apaGetTime(apa_ps2time_t *tm); +extern int apaGetIlinkID(u8 *idbuf); /////////////////////////////////////////////////////////////////////////////// -int apaPassCmp(const char *password1, const char *password2); -void apaEncryptPassword(const char *id, char *password_out, const char *password_in); +extern int apaPassCmp(const char *password1, const char *password2); +extern void apaEncryptPassword(const char *id, char *password_out, const char *password_in); /////////////////////////////////////////////////////////////////////////////// typedef struct @@ -214,6 +214,6 @@ typedef struct int status; } apa_device_t; -int apaGetFreeSectors(s32 device, u32 *free, apa_device_t *deviceinfo); +extern int apaGetFreeSectors(s32 device, u32 *free, apa_device_t *deviceinfo); #endif /* __LIBAPA_H__ */ diff --git a/iop/hdd/libpfs/include/libpfs.h b/iop/hdd/libpfs/include/libpfs.h index ce003dc209f..dc8fb73e4fc 100644 --- a/iop/hdd/libpfs/include/libpfs.h +++ b/iop/hdd/libpfs/include/libpfs.h @@ -221,133 +221,133 @@ typedef struct /////////////////////////////////////////////////////////////////////////////// // Super Block functions -#define PFS_SUPER_SECTOR 8192 -#define PFS_SUPER_BACKUP_SECTOR 8193 +#define PFS_SUPER_SECTOR 8192 +#define PFS_SUPER_BACKUP_SECTOR 8193 -int pfsCheckZoneSize(u32 zone_size); +extern int pfsCheckZoneSize(u32 zone_size); #ifdef PFS_SUPPORT_BHDD -int pfsCheckExtendedZoneSize(u32 zone_size); +extern int pfsCheckExtendedZoneSize(u32 zone_size); #endif -u32 pfsGetBitmapSizeSectors(int zoneScale, u32 partSize); -u32 pfsGetBitmapSizeBlocks(int scale, u32 mainsize); -int pfsFormatSub(pfs_block_device_t *blockDev, int fd, u32 sub, u32 reserved, u32 scale, u32 fragment); -int pfsFormat(pfs_block_device_t *blockDev, int fd, int zonesize, int fragment); -int pfsUpdateSuperBlock(pfs_mount_t *pfsMount, pfs_super_block_t *superblock, u32 sub); -int pfsMountSuperBlock(pfs_mount_t *pfsMount); +extern u32 pfsGetBitmapSizeSectors(int zoneScale, u32 partSize); +extern u32 pfsGetBitmapSizeBlocks(int scale, u32 mainsize); +extern int pfsFormatSub(pfs_block_device_t *blockDev, int fd, u32 sub, u32 reserved, u32 scale, u32 fragment); +extern int pfsFormat(pfs_block_device_t *blockDev, int fd, int zonesize, int fragment); +extern int pfsUpdateSuperBlock(pfs_mount_t *pfsMount, pfs_super_block_t *superblock, u32 sub); +extern int pfsMountSuperBlock(pfs_mount_t *pfsMount); /////////////////////////////////////////////////////////////////////////////// // Cache functions -void pfsCacheFree(pfs_cache_t *clink); -void pfsCacheLink(pfs_cache_t *clink, pfs_cache_t *cnew); -pfs_cache_t *pfsCacheUnLink(pfs_cache_t *clink); -pfs_cache_t *pfsCacheUsedAdd(pfs_cache_t *clink); -int pfsCacheTransfer(pfs_cache_t* clink, int mode); -void pfsCacheFlushAllDirty(pfs_mount_t *pfsMount); -pfs_cache_t *pfsCacheAlloc(pfs_mount_t *pfsMount, u16 sub, u32 block, int flags, int *result); -pfs_cache_t *pfsCacheGetData(pfs_mount_t *pfsMount, u16 sub, u32 block, int flags, int *result); -pfs_cache_t *pfsCacheAllocClean(int *result); -int pfsCacheIsFull(void); -int pfsCacheInit(u32 numBuf, u32 bufSize); -int pfsCacheDeinit(void); -void pfsCacheClose(pfs_mount_t *pfsMount); -void pfsCacheMarkClean(const pfs_mount_t *pfsMount, u32 subpart, u32 blockStart, u32 blockEnd); +extern void pfsCacheFree(pfs_cache_t *clink); +extern void pfsCacheLink(pfs_cache_t *clink, pfs_cache_t *cnew); +extern pfs_cache_t *pfsCacheUnLink(pfs_cache_t *clink); +extern pfs_cache_t *pfsCacheUsedAdd(pfs_cache_t *clink); +extern int pfsCacheTransfer(pfs_cache_t* clink, int mode); +extern void pfsCacheFlushAllDirty(pfs_mount_t *pfsMount); +extern pfs_cache_t *pfsCacheAlloc(pfs_mount_t *pfsMount, u16 sub, u32 block, int flags, int *result); +extern pfs_cache_t *pfsCacheGetData(pfs_mount_t *pfsMount, u16 sub, u32 block, int flags, int *result); +extern pfs_cache_t *pfsCacheAllocClean(int *result); +extern int pfsCacheIsFull(void); +extern int pfsCacheInit(u32 numBuf, u32 bufSize); +extern int pfsCacheDeinit(void); +extern void pfsCacheClose(pfs_mount_t *pfsMount); +extern void pfsCacheMarkClean(const pfs_mount_t *pfsMount, u32 subpart, u32 blockStart, u32 blockEnd); /////////////////////////////////////////////////////////////////////////////// -// Bitmap functions +// Bitmap functions -#define PFS_BITMAP_ALLOC 0 -#define PFS_BITMAP_FREE 1 +#define PFS_BITMAP_ALLOC 0 +#define PFS_BITMAP_FREE 1 typedef struct { - u32 chunk; - u32 index; - u32 bit; - u32 partitionChunks; - u32 partitionRemainder; + u32 chunk; + u32 index; + u32 bit; + u32 partitionChunks; + u32 partitionRemainder; } pfs_bitmapInfo_t; -void pfsBitmapSetupInfo(pfs_mount_t *pfsMount, pfs_bitmapInfo_t *info, u32 subpart, u32 number); -void pfsBitmapAllocFree(pfs_cache_t *clink, u32 operation, u32 subpart, u32 chunk, u32 index, u32 _bit, u32 count); -int pfsBitmapAllocateAdditionalZones(pfs_mount_t *pfsMount, pfs_blockinfo_t *bi, u32 count); -int pfsBitmapAllocZones(pfs_mount_t *pfsMount, pfs_blockinfo_t *bi, u32 amount); -int pfsBitmapSearchFreeZone(pfs_mount_t *pfsMount, pfs_blockinfo_t *bi, u32 max_count); -void pfsBitmapFreeBlockSegment(pfs_mount_t *pfsMount, pfs_blockinfo_t *bi); -int pfsBitmapCalcFreeZones(pfs_mount_t *pfsMount, int sub); -void pfsBitmapShow(pfs_mount_t *pfsMount); -void pfsBitmapFreeInodeBlocks(pfs_cache_t *clink); +extern void pfsBitmapSetupInfo(pfs_mount_t *pfsMount, pfs_bitmapInfo_t *info, u32 subpart, u32 number); +extern void pfsBitmapAllocFree(pfs_cache_t *clink, u32 operation, u32 subpart, u32 chunk, u32 index, u32 _bit, u32 count); +extern int pfsBitmapAllocateAdditionalZones(pfs_mount_t *pfsMount, pfs_blockinfo_t *bi, u32 count); +extern int pfsBitmapAllocZones(pfs_mount_t *pfsMount, pfs_blockinfo_t *bi, u32 amount); +extern int pfsBitmapSearchFreeZone(pfs_mount_t *pfsMount, pfs_blockinfo_t *bi, u32 max_count); +extern void pfsBitmapFreeBlockSegment(pfs_mount_t *pfsMount, pfs_blockinfo_t *bi); +extern int pfsBitmapCalcFreeZones(pfs_mount_t *pfsMount, int sub); +extern void pfsBitmapShow(pfs_mount_t *pfsMount); +extern void pfsBitmapFreeInodeBlocks(pfs_cache_t *clink); /////////////////////////////////////////////////////////////////////////////// -// Block functions +// Block functions -int pfsBlockSeekNextSegment(pfs_cache_t *clink, pfs_blockpos_t *blockpos); -u32 pfsBlockSyncPos(pfs_blockpos_t *blockpos, u64 size); -int pfsBlockInitPos(pfs_cache_t *clink, pfs_blockpos_t *blockpos, u64 position); -int pfsBlockExpandSegment(pfs_cache_t *clink, pfs_blockpos_t *blockpos, u32 count); -int pfsBlockAllocNewSegment(pfs_cache_t *clink, pfs_blockpos_t *blockpos, u32 blocks); -pfs_blockinfo_t* pfsBlockGetCurrent(pfs_blockpos_t *blockpos); -pfs_cache_t *pfsBlockGetNextSegment(pfs_cache_t *clink, int *result); -pfs_cache_t *pfsBlockGetLastSegmentDescriptorInode(pfs_cache_t *clink, int *result); +extern int pfsBlockSeekNextSegment(pfs_cache_t *clink, pfs_blockpos_t *blockpos); +extern u32 pfsBlockSyncPos(pfs_blockpos_t *blockpos, u64 size); +extern int pfsBlockInitPos(pfs_cache_t *clink, pfs_blockpos_t *blockpos, u64 position); +extern int pfsBlockExpandSegment(pfs_cache_t *clink, pfs_blockpos_t *blockpos, u32 count); +extern int pfsBlockAllocNewSegment(pfs_cache_t *clink, pfs_blockpos_t *blockpos, u32 blocks); +extern pfs_blockinfo_t* pfsBlockGetCurrent(pfs_blockpos_t *blockpos); +extern pfs_cache_t *pfsBlockGetNextSegment(pfs_cache_t *clink, int *result); +extern pfs_cache_t *pfsBlockGetLastSegmentDescriptorInode(pfs_cache_t *clink, int *result); /////////////////////////////////////////////////////////////////////////////// -// Directory-Entry (DEntry) inode functions - -pfs_cache_t *pfsGetDentry(pfs_cache_t *clink, char *path, pfs_dentry_t **dentry, u32 *size, int option); -int pfsGetNextDentry(pfs_cache_t *clink, pfs_blockpos_t *blockpos, u32 *position, char *name, pfs_blockinfo_t *bi); -pfs_cache_t *pfsFillDentry(pfs_cache_t *clink, pfs_dentry_t *dentry, char *path1, pfs_blockinfo_t *bi, u32 len, u16 mode); -pfs_cache_t *pfsDirAddEntry(pfs_cache_t *dir, char *filename, pfs_blockinfo_t *bi, u16 mode, int *result); -pfs_cache_t *pfsDirRemoveEntry(pfs_cache_t *clink, char *path); -int pfsCheckDirForFiles(pfs_cache_t *clink); -void pfsFillSelfAndParentDentries(pfs_cache_t *clink, pfs_blockinfo_t *self, pfs_blockinfo_t *parent); -pfs_cache_t* pfsSetDentryParent(pfs_cache_t *clink, pfs_blockinfo_t *bi, int *result); -pfs_cache_t *pfsInodeGetFileInDir(pfs_cache_t *dirInode, char *path, int *result); -pfs_cache_t *pfsInodeGetFile(pfs_mount_t *pfsMount, pfs_cache_t *clink, const char *name, int *result); -void pfsInodeFill(pfs_cache_t *ci, pfs_blockinfo_t *bi, u16 mode, u16 uid, u16 gid); -int pfsInodeRemove(pfs_cache_t *parent, pfs_cache_t *inode, char *path); -pfs_cache_t *pfsInodeGetParent(pfs_mount_t *pfsMount, pfs_cache_t *clink, const char *filename, char *path, int *result); -pfs_cache_t *pfsInodeCreate(pfs_cache_t *clink, u16 mode, u16 uid, u16 gid, int *result); -int pfsCheckAccess(pfs_cache_t *clink, int flags); -char* pfsSplitPath(char *filename, char *path, int *result); -u16 pfsGetMaxIndex(pfs_mount_t *pfsMount); - -int pfsAllocZones(pfs_cache_t *clink, int msize, int mode); -void pfsFreeZones(pfs_cache_t *pfree); +// Directory-Entry (DEntry) inode functions + +extern pfs_cache_t *pfsGetDentry(pfs_cache_t *clink, char *path, pfs_dentry_t **dentry, u32 *size, int option); +extern int pfsGetNextDentry(pfs_cache_t *clink, pfs_blockpos_t *blockpos, u32 *position, char *name, pfs_blockinfo_t *bi); +extern pfs_cache_t *pfsFillDentry(pfs_cache_t *clink, pfs_dentry_t *dentry, char *path1, pfs_blockinfo_t *bi, u32 len, u16 mode); +extern pfs_cache_t *pfsDirAddEntry(pfs_cache_t *dir, char *filename, pfs_blockinfo_t *bi, u16 mode, int *result); +extern pfs_cache_t *pfsDirRemoveEntry(pfs_cache_t *clink, char *path); +extern int pfsCheckDirForFiles(pfs_cache_t *clink); +extern void pfsFillSelfAndParentDentries(pfs_cache_t *clink, pfs_blockinfo_t *self, pfs_blockinfo_t *parent); +extern pfs_cache_t* pfsSetDentryParent(pfs_cache_t *clink, pfs_blockinfo_t *bi, int *result); +extern pfs_cache_t *pfsInodeGetFileInDir(pfs_cache_t *dirInode, char *path, int *result); +extern pfs_cache_t *pfsInodeGetFile(pfs_mount_t *pfsMount, pfs_cache_t *clink, const char *name, int *result); +extern void pfsInodeFill(pfs_cache_t *ci, pfs_blockinfo_t *bi, u16 mode, u16 uid, u16 gid); +extern int pfsInodeRemove(pfs_cache_t *parent, pfs_cache_t *inode, char *path); +extern pfs_cache_t *pfsInodeGetParent(pfs_mount_t *pfsMount, pfs_cache_t *clink, const char *filename, char *path, int *result); +extern pfs_cache_t *pfsInodeCreate(pfs_cache_t *clink, u16 mode, u16 uid, u16 gid, int *result); +extern int pfsCheckAccess(pfs_cache_t *clink, int flags); +extern char* pfsSplitPath(char *filename, char *path, int *result); +extern u16 pfsGetMaxIndex(pfs_mount_t *pfsMount); + +extern int pfsAllocZones(pfs_cache_t *clink, int msize, int mode); +extern void pfsFreeZones(pfs_cache_t *pfree); /////////////////////////////////////////////////////////////////////////////// -// Inode functions +// Inode functions -void pfsInodePrint(pfs_inode_t *inode); -int pfsInodeCheckSum(pfs_inode_t *inode); -void pfsInodeSetTime(pfs_cache_t *clink); -void pfsInodeSetTimeParent(pfs_cache_t *parent, pfs_cache_t *self); -pfs_cache_t *pfsInodeGetData(pfs_mount_t *pfsMount, u16 sub, u32 inode, int *result); -int pfsInodeSync(pfs_blockpos_t *blockpos, u64 size, u32 used_segments); -pfs_cache_t *pfsGetDentriesChunk(pfs_blockpos_t *position, int *result); -pfs_cache_t *pfsGetDentriesAtPos(pfs_cache_t *clink, u64 position, int *offset, int *result); +extern void pfsInodePrint(pfs_inode_t *inode); +extern int pfsInodeCheckSum(pfs_inode_t *inode); +extern void pfsInodeSetTime(pfs_cache_t *clink); +extern void pfsInodeSetTimeParent(pfs_cache_t *parent, pfs_cache_t *self); +extern pfs_cache_t *pfsInodeGetData(pfs_mount_t *pfsMount, u16 sub, u32 inode, int *result); +extern int pfsInodeSync(pfs_blockpos_t *blockpos, u64 size, u32 used_segments); +extern pfs_cache_t *pfsGetDentriesChunk(pfs_blockpos_t *position, int *result); +extern pfs_cache_t *pfsGetDentriesAtPos(pfs_cache_t *clink, u64 position, int *offset, int *result); /////////////////////////////////////////////////////////////////////////////// -// Journal functions +// Journal functions -int pfsJournalChecksum(void *header); -void pfsJournalWrite(pfs_mount_t *pfsMount, pfs_cache_t *clink, u32 pfsCacheNumBuffers); -int pfsJournalReset(pfs_mount_t *pfsMount); -int pfsJournalFlush(pfs_mount_t *pfsMount); -int pfsJournalRestore(pfs_mount_t *pfsMount); -int pfsJournalResetThis(pfs_block_device_t *blockDev, int fd, u32 sector); +extern int pfsJournalChecksum(void *header); +extern void pfsJournalWrite(pfs_mount_t *pfsMount, pfs_cache_t *clink, u32 pfsCacheNumBuffers); +extern int pfsJournalReset(pfs_mount_t *pfsMount); +extern int pfsJournalFlush(pfs_mount_t *pfsMount); +extern int pfsJournalRestore(pfs_mount_t *pfsMount); +extern int pfsJournalResetThis(pfs_block_device_t *blockDev, int fd, u32 sector); /////////////////////////////////////////////////////////////////////////////// -// Function declerations +// Function declerations -int pfsFsckStat(pfs_mount_t *pfsMount, pfs_super_block_t *superblock, u32 stat, int mode); +extern int pfsFsckStat(pfs_mount_t *pfsMount, pfs_super_block_t *superblock, u32 stat, int mode); -void *pfsAllocMem(int size); -void pfsFreeMem(void *buffer); -int pfsGetTime(pfs_datetime_t *tm); -void pfsPrintBitmap(const u32 *bitmap); +extern void *pfsAllocMem(int size); +extern void pfsFreeMem(void *buffer); +extern int pfsGetTime(pfs_datetime_t *tm); +extern void pfsPrintBitmap(const u32 *bitmap); -pfs_block_device_t *pfsGetBlockDeviceTable(const char *name); -u32 pfsGetScale(u32 num, u32 size); -u32 pfsFixIndex(u32 index); +extern pfs_block_device_t *pfsGetBlockDeviceTable(const char *name); +extern u32 pfsGetScale(u32 num, u32 size); +extern u32 pfsFixIndex(u32 index); #endif /* _LIBPFS_H */ diff --git a/iop/hdd/pfs/src/pfs.h b/iop/hdd/pfs/src/pfs.h index 53d9fbf08be..252bd4b2e54 100644 --- a/iop/hdd/pfs/src/pfs.h +++ b/iop/hdd/pfs/src/pfs.h @@ -58,7 +58,7 @@ typedef struct { /////////////////////////////////////////////////////////////////////////////// // Function declarations -pfs_mount_t *pfsGetMountedUnit(s32 unit); -void pfsClearMount(pfs_mount_t *pfsMount); +extern pfs_mount_t *pfsGetMountedUnit(s32 unit); +extern void pfsClearMount(pfs_mount_t *pfsMount); #endif /* _PFS_H */ diff --git a/iop/hdd/pfs/src/pfs_fio.h b/iop/hdd/pfs/src/pfs_fio.h index 11e1701b7d3..21bec5bbd7c 100644 --- a/iop/hdd/pfs/src/pfs_fio.h +++ b/iop/hdd/pfs/src/pfs_fio.h @@ -14,39 +14,39 @@ #define PFS_FDIRO (0x0008) /* internal use for dopen */ /////////////////////////////////////////////////////////////////////////////// -// Function declarations +// Function declarations -int pfsFioCheckForLastError(pfs_mount_t *pfsMount, int rv); -int pfsFioCheckFileSlot(pfs_file_slot_t *fileSlot); -pfs_mount_t *pfsFioGetMountedUnit(int unit); -void pfsFioCloseFileSlot(pfs_file_slot_t *fileSlot); +extern int pfsFioCheckForLastError(pfs_mount_t *pfsMount, int rv); +extern int pfsFioCheckFileSlot(pfs_file_slot_t *fileSlot); +extern pfs_mount_t *pfsFioGetMountedUnit(int unit); +extern void pfsFioCloseFileSlot(pfs_file_slot_t *fileSlot); /////////////////////////////////////////////////////////////////////////////// -// I/O functions +// I/O functions -int pfsFioInit(iomanX_iop_device_t *f); -int pfsFioDeinit(iomanX_iop_device_t *f); -int pfsFioFormat(iomanX_iop_file_t *, const char *dev, const char *blockdev, void *arg, int arglen); -int pfsFioOpen(iomanX_iop_file_t *f, const char *name, int flags, int mode); -int pfsFioClose(iomanX_iop_file_t *f); -int pfsFioRead(iomanX_iop_file_t *f, void *buf, int size); -int pfsFioWrite(iomanX_iop_file_t *f, void *buf, int size); -int pfsFioLseek(iomanX_iop_file_t *f, int pos, int whence); -int pfsFioRemove(iomanX_iop_file_t *f, const char *name); -int pfsFioMkdir(iomanX_iop_file_t *f, const char *path, int mode); -int pfsFioRmdir(iomanX_iop_file_t *f, const char *path); -int pfsFioDopen(iomanX_iop_file_t *f, const char *name); -int pfsFioDclose(iomanX_iop_file_t *f); -int pfsFioDread(iomanX_iop_file_t *f, iox_dirent_t *buf); -int pfsFioGetstat(iomanX_iop_file_t *f, const char *name, iox_stat_t *stat); -int pfsFioChstat(iomanX_iop_file_t *f, const char *name, iox_stat_t *stat, unsigned int statmask); -int pfsFioRename(iomanX_iop_file_t *f, const char *old, const char *new); -int pfsFioChdir(iomanX_iop_file_t *f, const char *name); -int pfsFioSync(iomanX_iop_file_t *f, const char *dev, int flag); -int pfsFioMount(iomanX_iop_file_t *f, const char *fsname, const char *devname, int flag, void *arg, int arglen); -int pfsFioUmount(iomanX_iop_file_t *f, const char *fsname); -s64 pfsFioLseek64(iomanX_iop_file_t *f, s64 offset, int whence); -int pfsFioSymlink(iomanX_iop_file_t *f, const char *old, const char *new); -int pfsFioReadlink(iomanX_iop_file_t *f, const char *path, char *buf, unsigned int buflen); +extern int pfsFioInit(iomanX_iop_device_t *f); +extern int pfsFioDeinit(iomanX_iop_device_t *f); +extern int pfsFioFormat(iomanX_iop_file_t *, const char *dev, const char *blockdev, void *arg, int arglen); +extern int pfsFioOpen(iomanX_iop_file_t *f, const char *name, int flags, int mode); +extern int pfsFioClose(iomanX_iop_file_t *f); +extern int pfsFioRead(iomanX_iop_file_t *f, void *buf, int size); +extern int pfsFioWrite(iomanX_iop_file_t *f, void *buf, int size); +extern int pfsFioLseek(iomanX_iop_file_t *f, int pos, int whence); +extern int pfsFioRemove(iomanX_iop_file_t *f, const char *name); +extern int pfsFioMkdir(iomanX_iop_file_t *f, const char *path, int mode); +extern int pfsFioRmdir(iomanX_iop_file_t *f, const char *path); +extern int pfsFioDopen(iomanX_iop_file_t *f, const char *name); +extern int pfsFioDclose(iomanX_iop_file_t *f); +extern int pfsFioDread(iomanX_iop_file_t *f, iox_dirent_t *buf); +extern int pfsFioGetstat(iomanX_iop_file_t *f, const char *name, iox_stat_t *stat); +extern int pfsFioChstat(iomanX_iop_file_t *f, const char *name, iox_stat_t *stat, unsigned int statmask); +extern int pfsFioRename(iomanX_iop_file_t *f, const char *old, const char *new); +extern int pfsFioChdir(iomanX_iop_file_t *f, const char *name); +extern int pfsFioSync(iomanX_iop_file_t *f, const char *dev, int flag); +extern int pfsFioMount(iomanX_iop_file_t *f, const char *fsname, const char *devname, int flag, void *arg, int arglen); +extern int pfsFioUmount(iomanX_iop_file_t *f, const char *fsname); +extern s64 pfsFioLseek64(iomanX_iop_file_t *f, s64 offset, int whence); +extern int pfsFioSymlink(iomanX_iop_file_t *f, const char *old, const char *new); +extern int pfsFioReadlink(iomanX_iop_file_t *f, const char *path, char *buf, unsigned int buflen); #endif /* _PFS_FIO_H */ diff --git a/iop/hdd/pfs/src/pfs_fioctl.h b/iop/hdd/pfs/src/pfs_fioctl.h index 8475a1250e8..dd4685a854c 100644 --- a/iop/hdd/pfs/src/pfs_fioctl.h +++ b/iop/hdd/pfs/src/pfs_fioctl.h @@ -14,10 +14,10 @@ /////////////////////////////////////////////////////////////////////////////// // Function declarations -int pfsFioIoctl(iomanX_iop_file_t *f, int cmd, void *param); -int pfsFioIoctl2(iomanX_iop_file_t *f, int cmd, void *arg, unsigned int arglen, void *buf, unsigned int buflen); -int pfsFioDevctl(iomanX_iop_file_t *f, const char *name, int cmd, void *arg, unsigned int arglen, void *buf, unsigned int buflen); +extern int pfsFioIoctl(iomanX_iop_file_t *f, int cmd, void *param); +extern int pfsFioIoctl2(iomanX_iop_file_t *f, int cmd, void *arg, unsigned int arglen, void *buf, unsigned int buflen); +extern int pfsFioDevctl(iomanX_iop_file_t *f, const char *name, int cmd, void *arg, unsigned int arglen, void *buf, unsigned int buflen); -void pfsFioDevctlCloseAll(void); +extern void pfsFioDevctlCloseAll(void); #endif /* _PFS_FIOCTL_H */ diff --git a/iop/iLink/IEEE1394_bd/src/include/sbp2_disk.h b/iop/iLink/IEEE1394_bd/src/include/sbp2_disk.h index 143e866f44a..2466206cda3 100644 --- a/iop/iLink/IEEE1394_bd/src/include/sbp2_disk.h +++ b/iop/iLink/IEEE1394_bd/src/include/sbp2_disk.h @@ -153,10 +153,10 @@ struct SBP2Device }; /* Function prototypes. */ -void init_ieee1394DiskDriver(void); -int ieee1394_SendCommandBlockORB(struct SBP2Device *dev, struct CommandDescriptorBlock *firstCDB); -int ieee1394_Sync(void); -void DeinitIEEE1394(void); +extern void init_ieee1394DiskDriver(void); +extern int ieee1394_SendCommandBlockORB(struct SBP2Device *dev, struct CommandDescriptorBlock *firstCDB); +extern int ieee1394_Sync(void); +extern void DeinitIEEE1394(void); #endif diff --git a/iop/iLink/IEEE1394_bd/src/include/scsi.h b/iop/iLink/IEEE1394_bd/src/include/scsi.h index 2b99c62f26b..882baf86537 100644 --- a/iop/iLink/IEEE1394_bd/src/include/scsi.h +++ b/iop/iLink/IEEE1394_bd/src/include/scsi.h @@ -11,8 +11,8 @@ struct scsi_interface int (*queue_cmd)(struct scsi_interface *scsi, const unsigned char *cmd, unsigned int cmd_len, unsigned char *data, unsigned int data_len, unsigned int data_wr); }; -int scsi_init(void); -void scsi_connect(struct scsi_interface *scsi); -void scsi_disconnect(struct scsi_interface *scsi); +extern int scsi_init(void); +extern void scsi_connect(struct scsi_interface *scsi); +extern void scsi_disconnect(struct scsi_interface *scsi); #endif diff --git a/iop/iLink/IEEE1394_disk/src/include/sbp2_disk.h b/iop/iLink/IEEE1394_disk/src/include/sbp2_disk.h index 72e44a3c963..e430bb74b45 100644 --- a/iop/iLink/IEEE1394_disk/src/include/sbp2_disk.h +++ b/iop/iLink/IEEE1394_disk/src/include/sbp2_disk.h @@ -128,7 +128,7 @@ struct SBP2Device }; /* Function prototypes. */ -void init_ieee1394DiskDriver(void); -int ieee1394_SendCommandBlockORB(struct SBP2Device *dev, struct CommandDescriptorBlock *firstCDB); -int ieee1394_Sync(void); -void DeinitIEEE1394(void); +extern void init_ieee1394DiskDriver(void); +extern int ieee1394_SendCommandBlockORB(struct SBP2Device *dev, struct CommandDescriptorBlock *firstCDB); +extern int ieee1394_Sync(void); +extern void DeinitIEEE1394(void); diff --git a/iop/iLink/IEEE1394_disk/src/include/scsi.h b/iop/iLink/IEEE1394_disk/src/include/scsi.h index a29ea47f44f..e401a7e8dae 100644 --- a/iop/iLink/IEEE1394_disk/src/include/scsi.h +++ b/iop/iLink/IEEE1394_disk/src/include/scsi.h @@ -46,7 +46,7 @@ typedef struct _read_capacity_data } read_capacity_data; /* Function prototypes. */ -int scsiReadSector(struct SBP2Device *dev, unsigned long int lba, void *buffer, int sectorCount); -int scsiWriteSector(struct SBP2Device *dev, unsigned long int lba, void *buffer, int sectorCount); -void releaseSBP2Device(struct SBP2Device *dev); -int ConfigureSBP2Device(struct SBP2Device *dev); +extern int scsiReadSector(struct SBP2Device *dev, unsigned long int lba, void *buffer, int sectorCount); +extern int scsiWriteSector(struct SBP2Device *dev, unsigned long int lba, void *buffer, int sectorCount); +extern void releaseSBP2Device(struct SBP2Device *dev); +extern int ConfigureSBP2Device(struct SBP2Device *dev); diff --git a/iop/iLink/iLinkman/include/iLinkman.h b/iop/iLink/iLinkman/include/iLinkman.h index ebf5bcdacb8..2d410915539 100644 --- a/iop/iLink/iLinkman/include/iLinkman.h +++ b/iop/iLink/iLinkman/include/iLinkman.h @@ -30,34 +30,34 @@ #define iLink_CB_LOCK_REQUEST 0x04 #define iLink_CB_BUS_RESET 0x08 -void iLinkEnableSBus(void); -void iLinkDisableSBus(void); -void iLinkResetSBus(void); -unsigned int iLinkSetNodeCapabilities(unsigned int capabilities); -void *iLinkSetTrCallbackHandler(void *function); -int iLinkGetGenerationNumber(void); - -int iLinkGetLocalNodeID(void); -int iLinkGetNodeCount(void); - -int iLinkTrAlloc(unsigned short int NodeID, unsigned char speed); -void iLinkTrFree(int trContext); -int iLinkTrWrite(int trContext, unsigned short int offset_high, unsigned int offset_low, void *buffer, unsigned int nBytes); -int iLinkTrRead(int trContext, unsigned short int offset_high, unsigned int offset_low, void *buffer, unsigned int nBytes); - -unsigned short int iLinkCalculateCRC16(void *data, unsigned int nQuads); -int iLinkAddCROMUnit(unsigned int *data, unsigned int nQuads); -void iLinkDeleteCROMUnit(unsigned int id); -int iLinkGetNodeCapabilities(unsigned short NodeID); -int iLinkGetNodeMaxSpeed(unsigned short int NodeID); - -int iLinkGetNodeTrSpeed(int trContext); -int iLinkSetNodeTrSpeed(int trContext, unsigned char speed); - -int iLinkFindUnit(int UnitInList, unsigned int UnitSpec, unsigned int UnitSW_Version); -int iLinkReadCROM(unsigned short int NodeID, unsigned int Offset, unsigned int nQuads, unsigned int *buffer); - -u64 iLinkGetLocalNodeEUI64(void); +extern void iLinkEnableSBus(void); +extern void iLinkDisableSBus(void); +extern void iLinkResetSBus(void); +extern unsigned int iLinkSetNodeCapabilities(unsigned int capabilities); +extern void *iLinkSetTrCallbackHandler(void *function); +extern int iLinkGetGenerationNumber(void); + +extern int iLinkGetLocalNodeID(void); +extern int iLinkGetNodeCount(void); + +extern int iLinkTrAlloc(unsigned short int NodeID, unsigned char speed); +extern void iLinkTrFree(int trContext); +extern int iLinkTrWrite(int trContext, unsigned short int offset_high, unsigned int offset_low, void *buffer, unsigned int nBytes); +extern int iLinkTrRead(int trContext, unsigned short int offset_high, unsigned int offset_low, void *buffer, unsigned int nBytes); + +extern unsigned short int iLinkCalculateCRC16(void *data, unsigned int nQuads); +extern int iLinkAddCROMUnit(unsigned int *data, unsigned int nQuads); +extern void iLinkDeleteCROMUnit(unsigned int id); +extern int iLinkGetNodeCapabilities(unsigned short NodeID); +extern int iLinkGetNodeMaxSpeed(unsigned short int NodeID); + +extern int iLinkGetNodeTrSpeed(int trContext); +extern int iLinkSetNodeTrSpeed(int trContext, unsigned char speed); + +extern int iLinkFindUnit(int UnitInList, unsigned int UnitSpec, unsigned int UnitSW_Version); +extern int iLinkReadCROM(unsigned short int NodeID, unsigned int Offset, unsigned int nQuads, unsigned int *buffer); + +extern u64 iLinkGetLocalNodeEUI64(void); #define iLinkman_IMPORTS_start DECLARE_IMPORT_TABLE(iLinkman, 1, 1) #define iLinkman_IMPORTS_end END_IMPORT_TABLE diff --git a/iop/iLink/iLinkman/src/include/iLink_internal.h b/iop/iLink/iLinkman/src/include/iLink_internal.h index f40e9f04a60..76805833aac 100644 --- a/iop/iLink/iLinkman/src/include/iLink_internal.h +++ b/iop/iLink/iLinkman/src/include/iLink_internal.h @@ -290,34 +290,34 @@ struct TransactionContextData }; /* Function prototypes. */ -void UBUFThread(void *arg); -int GetConsoleIDs(u64 *guid, char *ModelName); -void iLinkDisableIntr(void); -int iLinkResetHW(void); -void iLinkShutdownHW(void); -void iLinkHWInitialize(void); -void iLinkEnableCMaster(void); -void iLinkBusEnable(void); -void *malloc(unsigned int nBytes); -void free(void *buffer); - -void InitializeConfigurationROM(void); - -unsigned char iLinkReadPhy(unsigned char address); -void iLinkWritePhy(unsigned char address, unsigned char data); -void iLinkPHY_SetRootBit(int isRoot); -void iLinkPHY_SetGapCount(unsigned char GapCount); -void iLinkPHY_SetLCTRL(int LCTRL_status); -void iLinkPHYBusReset(void); - -int iLinkIntrHandler(void *arg); -void iLinkIntrRegister0Handler(void *arg); - -void SendResponse(unsigned short int NodeID, unsigned short RcvdBusID, unsigned char rcode, unsigned char tLabel, unsigned char tCode, unsigned char speed, unsigned int *buffer, unsigned int nQuads); -int iLinkReadReq(struct TransactionContextData *trContext, unsigned short int offset_high, unsigned int offset_low, void *buffer, unsigned int nBytes); -int iLinkWriteReq(struct TransactionContextData *trContext, unsigned short int offset_high, unsigned int offset_low, void *buffer, unsigned int nBytes); - -void iLinkInitPHT(void); -void PHTSendResponse(unsigned short int NodeID, unsigned short RcvdBusID, unsigned char rcode, unsigned char tLabel, unsigned char tCode, unsigned char speed, unsigned int *buffer, unsigned int nQuads); -int iLinkReadPHTReq(struct TransactionContextData *trContext, unsigned short int offset_high, unsigned int offset_low, void *buffer, unsigned int nBytes); -int iLinkWritePHTReq(struct TransactionContextData *trContext, unsigned short int offset_high, unsigned int offset_low, void *buffer, unsigned int nBytes); +extern void UBUFThread(void *arg); +extern int GetConsoleIDs(u64 *guid, char *ModelName); +extern void iLinkDisableIntr(void); +extern int iLinkResetHW(void); +extern void iLinkShutdownHW(void); +extern void iLinkHWInitialize(void); +extern void iLinkEnableCMaster(void); +extern void iLinkBusEnable(void); +extern void *malloc(unsigned int nBytes); +extern void free(void *buffer); + +extern void InitializeConfigurationROM(void); + +extern unsigned char iLinkReadPhy(unsigned char address); +extern void iLinkWritePhy(unsigned char address, unsigned char data); +extern void iLinkPHY_SetRootBit(int isRoot); +extern void iLinkPHY_SetGapCount(unsigned char GapCount); +extern void iLinkPHY_SetLCTRL(int LCTRL_status); +extern void iLinkPHYBusReset(void); + +extern int iLinkIntrHandler(void *arg); +extern void iLinkIntrRegister0Handler(void *arg); + +extern void SendResponse(unsigned short int NodeID, unsigned short RcvdBusID, unsigned char rcode, unsigned char tLabel, unsigned char tCode, unsigned char speed, unsigned int *buffer, unsigned int nQuads); +extern int iLinkReadReq(struct TransactionContextData *trContext, unsigned short int offset_high, unsigned int offset_low, void *buffer, unsigned int nBytes); +extern int iLinkWriteReq(struct TransactionContextData *trContext, unsigned short int offset_high, unsigned int offset_low, void *buffer, unsigned int nBytes); + +extern void iLinkInitPHT(void); +extern void PHTSendResponse(unsigned short int NodeID, unsigned short RcvdBusID, unsigned char rcode, unsigned char tLabel, unsigned char tCode, unsigned char speed, unsigned int *buffer, unsigned int nQuads); +extern int iLinkReadPHTReq(struct TransactionContextData *trContext, unsigned short int offset_high, unsigned int offset_low, void *buffer, unsigned int nBytes); +extern int iLinkWritePHTReq(struct TransactionContextData *trContext, unsigned short int offset_high, unsigned int offset_low, void *buffer, unsigned int nBytes); diff --git a/iop/kernel/include/cdvdfsv.h b/iop/kernel/include/cdvdfsv.h index 77b8a920e1a..2926f0b7a86 100644 --- a/iop/kernel/include/cdvdfsv.h +++ b/iop/kernel/include/cdvdfsv.h @@ -23,7 +23,7 @@ extern "C" { #endif -int sceCdChangeThreadPriority(int priority); +extern int sceCdChangeThreadPriority(int priority); #define cdvdfsv_IMPORTS_start DECLARE_IMPORT_TABLE(cdvdfsv, 1, 1) #define cdvdfsv_IMPORTS_end END_IMPORT_TABLE diff --git a/iop/kernel/include/cdvdman.h b/iop/kernel/include/cdvdman.h index 7622cbab9b8..a0e72221aea 100644 --- a/iop/kernel/include/cdvdman.h +++ b/iop/kernel/include/cdvdman.h @@ -121,24 +121,24 @@ typedef struct cdvdman_internal_struct_ } cdvdman_internal_struct_t; //IOP-only libcdvd function prototypes. -int sceCdCheckCmd(void); -int sceCdNop(void); -void *sceGetFsvRbuf(void); -int sceCdstm0Cb(void (*p)(int)); -int sceCdstm1Cb(void (*p)(int)); -int sceCdSC(int code, int *param); +extern int sceCdCheckCmd(void); +extern int sceCdNop(void); +extern void *sceGetFsvRbuf(void); +extern int sceCdstm0Cb(void (*p)(int)); +extern int sceCdstm1Cb(void (*p)(int)); +extern int sceCdSC(int code, int *param); /* Within all CDVDMAN modules, sceCdReadClock and sceCdRC both exist. In the old one, both have exactly the same code. In the newer ones, sceCdReadClock would automatically file off the most significant bit within the month field, while sceCdRC continued having its original behaviour of not changing the data. */ -int sceCdRC(sceCdCLOCK *clock); -int sceCdRead0(u32 lsn, u32 sectors, void *buffer, sceCdRMode *mode, int csec, void *callback); +extern int sceCdRC(sceCdCLOCK *clock); +extern int sceCdRead0(u32 lsn, u32 sectors, void *buffer, sceCdRMode *mode, int csec, void *callback); /** Reads DVD video. * SUPPORTED IN NEWER CDVDMAN MODULES WITHIN DVD PLAYER IOPRP ONLY * * @return 1 on success, 0 on failure. */ -int sceCdRV(u32 lsn, u32 sectors, void *buf, sceCdRMode *mode, int arg5, void *cb); +extern int sceCdRV(u32 lsn, u32 sectors, void *buf, sceCdRMode *mode, int arg5, void *cb); /** send an s-command by function number * @@ -148,7 +148,7 @@ int sceCdRV(u32 lsn, u32 sectors, void *buf, sceCdRMode *mode, int arg5, void *c * @param outBuff output buffer (can be null) * @return 1 on success, 0 on failure. */ -int sceCdApplySCmd2(u8 cmdNum, const void* inBuff, unsigned long int inBuffSize, void *outBuff); +extern int sceCdApplySCmd2(u8 cmdNum, const void* inBuff, unsigned long int inBuffSize, void *outBuff); /** send an s-command by function number * Unofficial name. @@ -160,7 +160,7 @@ int sceCdApplySCmd2(u8 cmdNum, const void* inBuff, unsigned long int inBuffSize, * @param outBuff output buffer (can be null) * @return 1 on success, 0 on failure. */ -int sceCdApplySCmd3(u8 cmdNum, const void* inBuff, unsigned long int inBuffSize, void *outBuff); +extern int sceCdApplySCmd3(u8 cmdNum, const void* inBuff, unsigned long int inBuffSize, void *outBuff); /** Controls spindle speed? Not sure what it really does. * SUPPORTED IN XCDVDMAN ONLY @@ -168,7 +168,7 @@ int sceCdApplySCmd3(u8 cmdNum, const void* inBuff, unsigned long int inBuffSize, * @param speed Speed mode. * @return 1 on success, 0 on failure. */ -int sceCdSpinCtrlIOP(u32 speed); +extern int sceCdSpinCtrlIOP(u32 speed); /** Set the eject callback when in ATAPI mode. * Unofficial name. @@ -178,7 +178,7 @@ int sceCdSpinCtrlIOP(u32 speed); * @param userdata The pointer to the userdata that will be passed to the callback * @return The old callback value */ -void *sceCdSetAtapiEjectCallback(int (*cb)(int reason, void *userdata), void *userdata); +extern void *sceCdSetAtapiEjectCallback(int (*cb)(int reason, void *userdata), void *userdata); //DNAS functions @@ -188,7 +188,7 @@ void *sceCdSetAtapiEjectCallback(int (*cb)(int reason, void *userdata), void *us * @param id integer where the Disk ID is stored. * @return 1 on success, 0 on failure. */ -int sceCdReadDiskID(unsigned int *id); +extern int sceCdReadDiskID(unsigned int *id); /** Deobfuscate using unique key. * Unofficial name. @@ -200,7 +200,7 @@ int sceCdReadDiskID(unsigned int *id); * @param status Command status * @return 1 on success, 0 on failure. */ -int sceCdDeobfuscateUsingUniqueKey(u8 *buffer, unsigned int shiftval, int xorval, u32 *status); +extern int sceCdDeobfuscateUsingUniqueKey(u8 *buffer, unsigned int shiftval, int xorval, u32 *status); #define cdvdman_IMPORTS_start DECLARE_IMPORT_TABLE(cdvdman, 1, 1) #define cdvdman_IMPORTS_end END_IMPORT_TABLE diff --git a/iop/kernel/include/dmacman.h b/iop/kernel/include/dmacman.h index 4a43fa24450..85fc7be1cea 100644 --- a/iop/kernel/include/dmacman.h +++ b/iop/kernel/include/dmacman.h @@ -79,60 +79,60 @@ enum _iop_dmac_ch { /* Note that these are far from official names. */ /* Memory ADdRess */ -void dmac_ch_set_madr(u32 channel, u32 val); -u32 dmac_ch_get_madr(u32 channel); +extern void dmac_ch_set_madr(u32 channel, u32 val); +extern u32 dmac_ch_get_madr(u32 channel); /* Block Control Register */ -void dmac_ch_set_bcr(u32 channel, u32 val); -u32 dmac_ch_get_bcr(u32 channel); +extern void dmac_ch_set_bcr(u32 channel, u32 val); +extern u32 dmac_ch_get_bcr(u32 channel); /* CHannel Control Register */ -void dmac_ch_set_chcr(u32 channel, u32 val); -u32 dmac_ch_get_chcr(u32 channel); +extern void dmac_ch_set_chcr(u32 channel, u32 val); +extern u32 dmac_ch_get_chcr(u32 channel); /* Tag ADdRess */ -void dmac_ch_set_tadr(u32 channel, u32 val); -u32 dmac_ch_get_tadr(u32 channel); +extern void dmac_ch_set_tadr(u32 channel, u32 val); +extern u32 dmac_ch_get_tadr(u32 channel); -void dmac_set_4_9_a(u32 channel, u32 val); -u32 dmac_get_4_9_a(u32 channel); +extern void dmac_set_4_9_a(u32 channel, u32 val); +extern u32 dmac_get_4_9_a(u32 channel); /* Dmac P??? Control Registers */ -void dmac_set_dpcr(u32 val); -u32 dmac_get_dpcr(void); -void dmac_set_dpcr2(u32 val); -u32 dmac_get_dpcr2(void); -void dmac_set_dpcr3(u32 val); -u32 dmac_get_dpcr3(void); +extern void dmac_set_dpcr(u32 val); +extern u32 dmac_get_dpcr(void); +extern void dmac_set_dpcr2(u32 val); +extern u32 dmac_get_dpcr2(void); +extern void dmac_set_dpcr3(u32 val); +extern u32 dmac_get_dpcr3(void); /* Dmac Interrupt Control Registers */ -void dmac_set_dicr(u32 val); -u32 dmac_get_dicr(void); -void dmac_set_dicr2(u32 val); -u32 dmac_get_dicr2(void); +extern void dmac_set_dicr(u32 val); +extern u32 dmac_get_dicr(void); +extern void dmac_set_dicr2(u32 val); +extern u32 dmac_get_dicr2(void); -void dmac_set_BF80157C(u32 val); -u32 dmac_get_BF80157C(void); +extern void dmac_set_BF80157C(u32 val); +extern u32 dmac_get_BF80157C(void); -void dmac_set_BF801578(u32 val); -u32 dmac_get_BF801578(void); +extern void dmac_set_BF801578(u32 val); +extern u32 dmac_get_BF801578(void); /* Initialize the given channel and start the transfer. Returns 1 if the transfer was started, and 0 on error. */ -int sceSetSliceDMA(u32 channel, void * addr, u32 size, u32 count, int dir); +extern int sceSetSliceDMA(u32 channel, void * addr, u32 size, u32 count, int dir); -int dmac_set_dma_chained_spu_sif0(u32 channel, u32 size, u32 tadr); -int dmac_set_dma_sif0(u32 channel, u32 size, u32 tadr); -int dmac_set_dma_sif1(u32 ch, u32 size); +extern int dmac_set_dma_chained_spu_sif0(u32 channel, u32 size, u32 tadr); +extern int dmac_set_dma_sif0(u32 channel, u32 size, u32 tadr); +extern int dmac_set_dma_sif1(u32 ch, u32 size); /* Start a transfer on the given channel. */ -void sceStartDMA(u32 channel); +extern void sceStartDMA(u32 channel); /* Set the DPCRn value for a specific channel. */ -void sceSetDMAPriority(u32 channel, u32 val); +extern void sceSetDMAPriority(u32 channel, u32 val); -void sceEnableDMAChannel(u32 channel); -void sceDisableDMAChannel(u32 channel); +extern void sceEnableDMAChannel(u32 channel); +extern void sceDisableDMAChannel(u32 channel); #define dmacman_IMPORTS_start DECLARE_IMPORT_TABLE(dmacman, 1, 1) #define dmacman_IMPORTS_end END_IMPORT_TABLE diff --git a/iop/kernel/include/excepman.h b/iop/kernel/include/excepman.h index 7e974000321..650e16455c8 100644 --- a/iop/kernel/include/excepman.h +++ b/iop/kernel/include/excepman.h @@ -66,14 +66,14 @@ typedef struct _exception_handler_struct_t typedef exception_handler_struct_t* exception_handler_t; -void* GetExHandlersTable(); +extern void* GetExHandlersTable(); /** will call RegisterPriorityExceptionHandler with prio = 2 */ -int RegisterExceptionHandler(int exception, exception_handler_t handler); -int RegisterPriorityExceptionHandler(int exception, int priority, exception_handler_t handler); -int RegisterDefaultExceptionHandler(exception_handler_t handler); -int ReleaseExceptionHandler(int exception, exception_handler_t handler); -int ReleaseDefaultExceptionHandler(exception_handler_t handler); +extern int RegisterExceptionHandler(int exception, exception_handler_t handler); +extern int RegisterPriorityExceptionHandler(int exception, int priority, exception_handler_t handler); +extern int RegisterDefaultExceptionHandler(exception_handler_t handler); +extern int ReleaseExceptionHandler(int exception, exception_handler_t handler); +extern int ReleaseDefaultExceptionHandler(exception_handler_t handler); #define excepman_IMPORTS_start DECLARE_IMPORT_TABLE(excepman, 1, 2) #define excepman_IMPORTS_end END_IMPORT_TABLE diff --git a/iop/kernel/include/heaplib.h b/iop/kernel/include/heaplib.h index bdd31da1b96..1d3f8755133 100644 --- a/iop/kernel/include/heaplib.h +++ b/iop/kernel/include/heaplib.h @@ -23,14 +23,14 @@ extern "C" { #endif -void *CreateHeap(int heapblocksize, int flag); -void DeleteHeap(void *heap); -void *AllocHeapMemory(void *heap, size_t nbytes); -int FreeHeapMemory(void *heap, void *ptr); -int HeapTotalFreeSize(void *heap); - -void HeapPrepare(void* mem, int size); -int HeapChunkSize(void* chunk); +extern void *CreateHeap(int heapblocksize, int flag); +extern void DeleteHeap(void *heap); +extern void *AllocHeapMemory(void *heap, size_t nbytes); +extern int FreeHeapMemory(void *heap, void *ptr); +extern int HeapTotalFreeSize(void *heap); + +extern void HeapPrepare(void* mem, int size); +extern int HeapChunkSize(void* chunk); #define heaplib_IMPORTS_start DECLARE_IMPORT_TABLE(heaplib, 1, 1) #define heaplib_IMPORTS_end END_IMPORT_TABLE diff --git a/iop/kernel/include/intrman.h b/iop/kernel/include/intrman.h index a55d0ebec8d..76b7416e903 100644 --- a/iop/kernel/include/intrman.h +++ b/iop/kernel/include/intrman.h @@ -91,7 +91,7 @@ typedef struct intrman_internals_ int dmac2_interrupt_handler_mask; } intrman_internals_t; -intrman_internals_t *GetIntrmanInternalData(void); +extern intrman_internals_t *GetIntrmanInternalData(void); /** * Register an interrupt handler for the specified interrupt. @@ -104,21 +104,21 @@ intrman_internals_t *GetIntrmanInternalData(void); * @param arg An optional pointer to data that will be passed to the interrupt handler, whenever it is to be invoked. * @return 0 on success, non-zero error code on failure. */ -int RegisterIntrHandler(int irq, int mode, int (*handler)(void *), void *arg); +extern int RegisterIntrHandler(int irq, int mode, int (*handler)(void *), void *arg); /** * Releases (deregisters) the interrupt handler for the specified interrupt. * @param irq Interrupt cause to release the interrupt handler for. * @return 0 on success, non-zero error code on failure. */ -int ReleaseIntrHandler(int irq); +extern int ReleaseIntrHandler(int irq); /** * Enables (unmasks) the specified hardware interrupt cause. * @param irq Interrupt cause to enable. * @return Returns 0 on success, non-zero error code on failure. */ -int EnableIntr(int irq); +extern int EnableIntr(int irq); /** * Disables (masks) the specified hardware interrupt cause. @@ -126,7 +126,7 @@ int EnableIntr(int irq); * @param res Pointer to a variable to receive the interrupt number of the interrupt that was disabled. * @return Returns 0 on success, non-zero error code on failure. */ -int DisableIntr(int irq, int *res); +extern int DisableIntr(int irq, int *res); /** * Disables interrupts, regardless of the current statue. This is deprecated. @@ -134,14 +134,14 @@ int DisableIntr(int irq, int *res); * May be called from an interrupt or thread context. * @return Returns 0 on success, non-zero error code on failure. */ -int CpuDisableIntr(); +extern int CpuDisableIntr(); /** * Enables interrupts, regardless of the current state. This is deprecated. * The interrupt mask registers for each interrupt cause will not be changed. * May be called from an interrupt or thread context. * @return Returns 0 on success, non-zero error code on failure. */ -int CpuEnableIntr(); +extern int CpuEnableIntr(); /** * Disables interrupts. @@ -151,7 +151,7 @@ int CpuEnableIntr(); * @return Returns 0 on success, non-zero error code on failure. * @see CpuResumeIntr() */ -int CpuSuspendIntr(int *state); +extern int CpuSuspendIntr(int *state); /** * Enables interrupts. @@ -161,51 +161,51 @@ int CpuSuspendIntr(int *state); * @return Returns 0 on success, non-zero error code on failure. * @see CpuSuspendIntr() */ -int CpuResumeIntr(int state); +extern int CpuResumeIntr(int state); /** * Invokes a function in kernel mode via a syscall handler. This is usually used for synchronization between interrupt and DECI2 contexts. * @param function A pointer to the function to call. Specify other arguments for the function, after function. * @return The return value of the function. */ -int CpuInvokeInKmode(void *function, ...); +extern int CpuInvokeInKmode(void *function, ...); /** * Disables dispatching of the interrupt handler, by INTRMAN. Used by DECI2, when DECI2RS is to manage the SIF2 and SBUS interrupts. * This does not change the interrupt mask status. * @param irq The interrupt to mask in software. */ -void DisableDispatchIntr(int irq); +extern void DisableDispatchIntr(int irq); /** * Enables dispatching of the interrupt handler, by INTRMAN. * This does not change the interrupt mask status. * @param irq The interrupt to unmask in software. */ -void EnableDispatchIntr(int irq); +extern void EnableDispatchIntr(int irq); /** * Indicates whether execution is currently within an interrupt or thread context. * @return 1 if within the interrupt context, 0 if not. */ -int QueryIntrContext(void); +extern int QueryIntrContext(void); /** * Indicates whether the specified stack pointer is within the interrupt stack. * @param sp The stack pointer to check. * @return 1 if the specified stack pointer is within the interrupt stack, 0 if not. */ -int QueryIntrStack(void *sp); +extern int QueryIntrStack(void *sp); -int iCatchMultiIntr(void); +extern int iCatchMultiIntr(void); /** * These set callback functions for thread support * Only the thread manager should set these */ -void SetNewCtxCb(void *cb); -void ResetNewCtxCb(void); -void SetShouldPreemptCb(void *cb); -void ResetShouldPreemptCb(void); +extern void SetNewCtxCb(void *cb); +extern void ResetNewCtxCb(void); +extern void SetShouldPreemptCb(void *cb); +extern void ResetShouldPreemptCb(void); #define intrman_IMPORTS_start DECLARE_IMPORT_TABLE(intrman, 1, 2) #define intrman_IMPORTS_end END_IMPORT_TABLE diff --git a/iop/kernel/include/ioman.h b/iop/kernel/include/ioman.h index 42b386268da..3992243ee91 100644 --- a/iop/kernel/include/ioman.h +++ b/iop/kernel/include/ioman.h @@ -25,21 +25,21 @@ extern "C" { #endif -int open(const char *name, int mode); -int close(int fd); -int read(int fd, void *ptr, size_t size); -int write(int fd, void *ptr, size_t size); -int lseek(int fd, int pos, int mode); -int ioctl(int fd, int command, void *arg); -int remove(const char *name); -int mkdir(const char *path); -int rmdir(const char *path); -int dopen(const char *path, int mode); -int dclose(int fd); -int dread(int fd, io_dirent_t *buf); -int getstat(const char *name, io_stat_t *stat); -int chstat(const char *name, io_stat_t *stat, unsigned int statmask); -int format(const char *dev); +extern int open(const char *name, int mode); +extern int close(int fd); +extern int read(int fd, void *ptr, size_t size); +extern int write(int fd, void *ptr, size_t size); +extern int lseek(int fd, int pos, int mode); +extern int ioctl(int fd, int command, void *arg); +extern int remove(const char *name); +extern int mkdir(const char *path); +extern int rmdir(const char *path); +extern int dopen(const char *path, int mode); +extern int dclose(int fd); +extern int dread(int fd, io_dirent_t *buf); +extern int getstat(const char *name, io_stat_t *stat); +extern int chstat(const char *name, io_stat_t *stat, unsigned int statmask); +extern int format(const char *dev); /* Device drivers. */ @@ -100,8 +100,8 @@ typedef struct _iop_device_ops { int (*chstat)(iop_file_t *, const char *, io_stat_t *, unsigned int); } iop_device_ops_t; -int AddDrv(iop_device_t *device); -int DelDrv(const char *name); +extern int AddDrv(iop_device_t *device); +extern int DelDrv(const char *name); #define ioman_IMPORTS_start DECLARE_IMPORT_TABLE(ioman, 1, 1) #define ioman_IMPORTS_end END_IMPORT_TABLE diff --git a/iop/kernel/include/ioman_mod.h b/iop/kernel/include/ioman_mod.h index 51c6d143d06..96e0d0be901 100644 --- a/iop/kernel/include/ioman_mod.h +++ b/iop/kernel/include/ioman_mod.h @@ -26,21 +26,21 @@ extern "C" { #endif -int io_open(const char *name, int mode); -int io_close(int fd); -int io_read(int fd, void *ptr, size_t size); -int io_write(int fd, void *ptr, size_t size); -int io_lseek(int fd, int pos, int mode); -int io_ioctl(int fd, unsigned long arg, void *param); -int io_remove(const char *name); -int io_mkdir(const char *path); -int io_rmdir(const char *path); -int io_dopen(const char *path, int mode); -int io_dclose(int fd); -int io_dread(int fd, io_dirent_t *buf); -int io_getstat(const char *name, io_stat_t *stat); -int io_chstat(const char *name, io_stat_t *stat, unsigned int statmask); -int io_format(const char *dev); +extern int io_open(const char *name, int mode); +extern int io_close(int fd); +extern int io_read(int fd, void *ptr, size_t size); +extern int io_write(int fd, void *ptr, size_t size); +extern int io_lseek(int fd, int pos, int mode); +extern int io_ioctl(int fd, unsigned long arg, void *param); +extern int io_remove(const char *name); +extern int io_mkdir(const char *path); +extern int io_rmdir(const char *path); +extern int io_dopen(const char *path, int mode); +extern int io_dclose(int fd); +extern int io_dread(int fd, io_dirent_t *buf); +extern int io_getstat(const char *name, io_stat_t *stat); +extern int io_chstat(const char *name, io_stat_t *stat, unsigned int statmask); +extern int io_format(const char *dev); /* Device drivers. */ @@ -92,8 +92,8 @@ typedef struct _iop_io_device_ops { int (*io_chstat)(iop_io_file_t *, const char *, io_stat_t *, unsigned int); } iop_io_device_ops_t; -int io_AddDrv(iop_io_device_t *device); -int io_DelDrv(const char *name); +extern int io_AddDrv(iop_io_device_t *device); +extern int io_DelDrv(const char *name); #define ioman_mod_IMPORTS_start DECLARE_IMPORT_TABLE(ioman, 1, 1) #define ioman_mod_IMPORTS_end END_IMPORT_TABLE diff --git a/iop/kernel/include/loadcore.h b/iop/kernel/include/loadcore.h index 44b69963c23..a150cce4070 100644 --- a/iop/kernel/include/loadcore.h +++ b/iop/kernel/include/loadcore.h @@ -114,40 +114,40 @@ typedef struct { /** * Retained for backward-compatibility with older projects. This function actually returns a pointer to LOADCORE's internal data structure. */ -iop_library_table_t *GetLibraryEntryTable(void) __attribute__ ((deprecated)); -lc_internals_t *GetLoadcoreInternalData(void); +extern iop_library_table_t *GetLibraryEntryTable(void) __attribute__ ((deprecated)); +extern lc_internals_t *GetLoadcoreInternalData(void); -void FlushIcache(void); -void FlushDcache(void); +extern void FlushIcache(void); +extern void FlushDcache(void); -int RegisterLibraryEntries(struct irx_export_table *exports); -int ReleaseLibraryEntries(struct irx_export_table *exports); +extern int RegisterLibraryEntries(struct irx_export_table *exports); +extern int ReleaseLibraryEntries(struct irx_export_table *exports); // In liberx, the following is LinkLibraryClients -int LinkLibraryEntries(void* addr, int size); +extern int LinkLibraryEntries(void* addr, int size); // In liberx, the following is UnLinkLibraryClients -int UnLinkLibraryEntries(void* addr, int size); +extern int UnLinkLibraryEntries(void* addr, int size); -int RegisterNonAutoLinkEntries(struct irx_export_table *exports); +extern int RegisterNonAutoLinkEntries(struct irx_export_table *exports); // In liberx, the following is SearchLibraryEntries -void *QueryLibraryEntryTable(iop_library_t *library); -int * QueryBootMode(int mode); -void RegisterBootMode(iop_bootmode_t *b); +extern void *QueryLibraryEntryTable(iop_library_t *library); +extern int * QueryBootMode(int mode); +extern void RegisterBootMode(iop_bootmode_t *b); -void LockLibraryClient(struct irx_export_table *export); -void UnLockLibraryClient(struct irx_export_table *export); +extern void LockLibraryClient(struct irx_export_table *export); +extern void UnLockLibraryClient(struct irx_export_table *export); -void RegisterModule(ModuleInfo_t *mi); -void ReleaseModule(ModuleInfo_t *mi); +extern void RegisterModule(ModuleInfo_t *mi); +extern void ReleaseModule(ModuleInfo_t *mi); -int AddRebootNotifyHandler(BootupCallback_t func, int priority, int *stat); +extern int AddRebootNotifyHandler(BootupCallback_t func, int priority, int *stat); -void SetCacheCtrl(u32 val); +extern void SetCacheCtrl(u32 val); -int ProbeExecutableObject(void* image, FileInfo_t *result); -int LoadExecutableObject(void* image, FileInfo_t *fi); -ModuleInfo_t *SearchModuleCBByAddr(void* addr); +extern int ProbeExecutableObject(void* image, FileInfo_t *result); +extern int LoadExecutableObject(void* image, FileInfo_t *fi); +extern ModuleInfo_t *SearchModuleCBByAddr(void* addr); #define loadcore_IMPORTS \ loadcore_IMPORTS_start \ diff --git a/iop/kernel/include/modload.h b/iop/kernel/include/modload.h index 0d64add0f1d..2f382ab428b 100644 --- a/iop/kernel/include/modload.h +++ b/iop/kernel/include/modload.h @@ -121,20 +121,20 @@ typedef void *(*SecrDiskBootFile_callback_t)(void *buffer); typedef void (*SetLoadfileCallbacks_callback_t)(SetLoadfileCallbacks_struct_t *callbackinfo); typedef int (*CheckKelfPath_callback_t)(const char *filename, int *port, int *slot); -void GetModloadInternalData(void **pInternalData); - -int ReBootStart(const char *command, unsigned int flags); -int LoadModuleAddress(const char *name, void *addr, int offset); -int LoadModule(const char *name); -int LoadStartModule(const char *name, int arglen, const char *args, int *result); -int StartModule(int modid, const char *name, int arglen, const char *args, int *result); -int LoadModuleBufferAddress(void *buffer, void *addr, int offset); -int LoadModuleBuffer(void *buffer); -int LoadStartKelfModule(const char *name, int arglen, const char *args, int *result); -void SetSecrmanCallbacks(SecrCardBootFile_callback_t SecrCardBootFile_fnc, SecrDiskBootFile_callback_t SecrDiskBootFile_fnc, SetLoadfileCallbacks_callback_t SetLoadfileCallbacks_fnc); -void SetCheckKelfPathCallback(CheckKelfPath_callback_t CheckKelfPath_fnc); -void GetLoadfileCallbacks(CheckKelfPath_callback_t *CheckKelfPath_fnc, SetLoadfileCallbacks_callback_t *SetLoadfileCallbacks_fnc); -int IsIllegalBootDevice(const char *path); +extern void GetModloadInternalData(void **pInternalData); + +extern int ReBootStart(const char *command, unsigned int flags); +extern int LoadModuleAddress(const char *name, void *addr, int offset); +extern int LoadModule(const char *name); +extern int LoadStartModule(const char *name, int arglen, const char *args, int *result); +extern int StartModule(int modid, const char *name, int arglen, const char *args, int *result); +extern int LoadModuleBufferAddress(void *buffer, void *addr, int offset); +extern int LoadModuleBuffer(void *buffer); +extern int LoadStartKelfModule(const char *name, int arglen, const char *args, int *result); +extern void SetSecrmanCallbacks(SecrCardBootFile_callback_t SecrCardBootFile_fnc, SecrDiskBootFile_callback_t SecrDiskBootFile_fnc, SetLoadfileCallbacks_callback_t SetLoadfileCallbacks_fnc); +extern void SetCheckKelfPathCallback(CheckKelfPath_callback_t CheckKelfPath_fnc); +extern void GetLoadfileCallbacks(CheckKelfPath_callback_t *CheckKelfPath_fnc, SetLoadfileCallbacks_callback_t *SetLoadfileCallbacks_fnc); +extern int IsIllegalBootDevice(const char *path); #define modload_IMPORTS_start DECLARE_IMPORT_TABLE(modload, 1, 1) #define modload_IMPORTS_end END_IMPORT_TABLE diff --git a/iop/kernel/include/setjmp.h b/iop/kernel/include/setjmp.h index 65235c5d98b..1109ed0cfde 100644 --- a/iop/kernel/include/setjmp.h +++ b/iop/kernel/include/setjmp.h @@ -30,8 +30,8 @@ typedef _JBTYPE jmp_buf[_JBLEN]; extern "C" { #endif -int setjmp(jmp_buf env); -void longjmp(jmp_buf env, int val) __attribute__ ((noreturn)); +extern int setjmp(jmp_buf env); +extern void longjmp(jmp_buf env, int val) __attribute__ ((noreturn)); #ifdef __cplusplus } diff --git a/iop/kernel/include/sifcmd.h b/iop/kernel/include/sifcmd.h index c4ee6dcb1be..589dcc97617 100644 --- a/iop/kernel/include/sifcmd.h +++ b/iop/kernel/include/sifcmd.h @@ -75,13 +75,13 @@ typedef struct t_SifCmdSysHandlerData void *unknown08; } SifCmdSysHandlerData_t; -void sceSifInitCmd(void); -void sceSifExitCmd(void); -unsigned int sceSifGetSreg(int index); -void sceSifSetSreg(int index, unsigned int value); -void sceSifSetCmdBuffer(SifCmdHandlerData_t *cmdBuffer, int size); -void sceSifSetSysCmdBuffer(SifCmdSysHandlerData_t *sysCmdBuffer, int size); -void sceSifAddCmdHandler(int cid, SifCmdHandler_t handler, void *harg); +extern void sceSifInitCmd(void); +extern void sceSifExitCmd(void); +extern unsigned int sceSifGetSreg(int index); +extern void sceSifSetSreg(int index, unsigned int value); +extern void sceSifSetCmdBuffer(SifCmdHandlerData_t *cmdBuffer, int size); +extern void sceSifSetSysCmdBuffer(SifCmdSysHandlerData_t *sysCmdBuffer, int size); +extern void sceSifAddCmdHandler(int cid, SifCmdHandler_t handler, void *harg); /* SIF RPC. */ @@ -213,37 +213,37 @@ typedef struct t_SifRpcDataQueue { } SifRpcDataQueue_t; -void sceSifRemoveCmdHandler(int cid); -unsigned int sceSifSendCmd(int cmd, void *packet, int packet_size, void *src_extra, - void *dest_extra, int size_extra); -unsigned int isceSifSendCmd(int cmd, void *packet, int packet_size, void *src_extra, - void *dest_extra, int size_extra); +extern void sceSifRemoveCmdHandler(int cid); +extern unsigned int sceSifSendCmd(int cmd, void *packet, int packet_size, void *src_extra, + void *dest_extra, int size_extra); +extern unsigned int isceSifSendCmd(int cmd, void *packet, int packet_size, void *src_extra, + void *dest_extra, int size_extra); -void sceSifInitRpc(int mode); -int sceSifBindRpc(SifRpcClientData_t * client, int rpc_number, int mode); -int sceSifCallRpc(SifRpcClientData_t * client, int rpc_number, int mode, void *send, - int ssize, void *receive, int rsize, SifRpcEndFunc_t end_function, void *end_param); +extern void sceSifInitRpc(int mode); +extern int sceSifBindRpc(SifRpcClientData_t * client, int rpc_number, int mode); +extern int sceSifCallRpc(SifRpcClientData_t * client, int rpc_number, int mode, void *send, + int ssize, void *receive, int rsize, SifRpcEndFunc_t end_function, void *end_param); -void sceSifRegisterRpc(SifRpcServerData_t *sd, int sid, SifRpcFunc_t func, void *buf, - SifRpcFunc_t cfunc, void *cbuf, SifRpcDataQueue_t *qd); +extern void sceSifRegisterRpc(SifRpcServerData_t *sd, int sid, SifRpcFunc_t func, void *buf, + SifRpcFunc_t cfunc, void *cbuf, SifRpcDataQueue_t *qd); -int sceSifCheckStatRpc(SifRpcClientData_t * cd); +extern int sceSifCheckStatRpc(SifRpcClientData_t * cd); -SifRpcDataQueue_t * sceSifSetRpcQueue(SifRpcDataQueue_t *q, int thread_id); -SifRpcServerData_t *sceSifGetNextRequest(SifRpcDataQueue_t * qd); -void sceSifExecRequest(SifRpcServerData_t * srv); -void sceSifRpcLoop(SifRpcDataQueue_t *qd); +extern SifRpcDataQueue_t * sceSifSetRpcQueue(SifRpcDataQueue_t *q, int thread_id); +extern SifRpcServerData_t *sceSifGetNextRequest(SifRpcDataQueue_t * qd); +extern void sceSifExecRequest(SifRpcServerData_t * srv); +extern void sceSifRpcLoop(SifRpcDataQueue_t *qd); -int sceSifGetOtherData(SifRpcReceiveData_t *rd, void *src, void *dest, int size, int mode); +extern int sceSifGetOtherData(SifRpcReceiveData_t *rd, void *src, void *dest, int size, int mode); -SifRpcServerData_t *sceSifRemoveRpc(SifRpcServerData_t *sd, SifRpcDataQueue_t *qd); -SifRpcDataQueue_t *sceSifRemoveRpcQueue(SifRpcDataQueue_t *qd); -void sceSifSetSif1CB(void (*func)(void *userdata), void *userdata); -void sceSifClearSif1CB(void); -unsigned int sceSifSendCmdIntr(int cmd, void *packet, int packet_size, void *src_extra, - void *dest_extra, int size_extra, void (*completioncb)(void *userdata), void *userdata); -unsigned int isceSifSendCmdIntr(int cmd, void *packet, int packet_size, void *src_extra, - void *dest_extra, int size_extra, void (*completioncb)(void *userdata), void *userdata); +extern SifRpcServerData_t *sceSifRemoveRpc(SifRpcServerData_t *sd, SifRpcDataQueue_t *qd); +extern SifRpcDataQueue_t *sceSifRemoveRpcQueue(SifRpcDataQueue_t *qd); +extern void sceSifSetSif1CB(void (*func)(void *userdata), void *userdata); +extern void sceSifClearSif1CB(void); +extern unsigned int sceSifSendCmdIntr(int cmd, void *packet, int packet_size, void *src_extra, + void *dest_extra, int size_extra, void (*completioncb)(void *userdata), void *userdata); +extern unsigned int isceSifSendCmdIntr(int cmd, void *packet, int packet_size, void *src_extra, + void *dest_extra, int size_extra, void (*completioncb)(void *userdata), void *userdata); /* Compatibility names for use with ps2lib. */ #define SifInitRpc sceSifInitRpc diff --git a/iop/kernel/include/sifman.h b/iop/kernel/include/sifman.h index 601241afac2..d906ea2c0b9 100644 --- a/iop/kernel/include/sifman.h +++ b/iop/kernel/include/sifman.h @@ -74,13 +74,13 @@ enum _sif_regs { * don't really care. */ -void sceSifDma2Init(); -void sceSifInit(); +extern void sceSifDma2Init(); +extern void sceSifInit(); -void sceSifSetDChain(); +extern void sceSifSetDChain(); -int sceSifSetDma(SifDmaTransfer_t *dmat, int count); -int sceSifDmaStat(int trid); +extern int sceSifSetDma(SifDmaTransfer_t *dmat, int count); +extern int sceSifDmaStat(int trid); /* Compatibility names for use with ps2lib. */ #define SifSetDChain sceSifSetDChain @@ -91,57 +91,57 @@ int sceSifDmaStat(int trid); * All of these except sceSifCheckInit() & sceSifSetDmaIntr() have been * aribitrarily named. */ -void sceSifSetOneDma(SifDmaTransfer_t dmat); +extern void sceSifSetOneDma(SifDmaTransfer_t dmat); -void sceSifSendSync(); -int sceSifIsSending(); +extern void sceSifSendSync(); +extern int sceSifIsSending(); -void sceSifDma0Transfer(void *addr, int size, int mode); -void sceSifDma0Sync(); -int sceSifDma0Sending(); +extern void sceSifDma0Transfer(void *addr, int size, int mode); +extern void sceSifDma0Sync(); +extern int sceSifDma0Sending(); -void sceSifDma1Transfer(void *addr, int size, int mode); -void sceSifDma1Sync(); -int sceSifDma1Sending(); +extern void sceSifDma1Transfer(void *addr, int size, int mode); +extern void sceSifDma1Sync(); +extern int sceSifDma1Sending(); -void sceSifDma2Transfer(void *addr, int size, int mode); -void sceSifDma2Sync(); -int sceSifDma2Sending(); +extern void sceSifDma2Transfer(void *addr, int size, int mode); +extern void sceSifDma2Sync(); +extern int sceSifDma2Sending(); /* * SBUS Main->Sub CPU status register */ -u32 sceSifGetMSFlag(); -u32 sceSifSetMSFlag(u32 val); +extern u32 sceSifGetMSFlag(); +extern u32 sceSifSetMSFlag(u32 val); /* * SBUS Sub->Main CPU status register */ -u32 sceSifGetSMFlag(); -u32 sceSifSetSMFlag(u32 val); +extern u32 sceSifGetSMFlag(); +extern u32 sceSifSetSMFlag(u32 val); /* * SBUS Main CPU DMA receive address */ -u32 sceSifGetMainAddr(); +extern u32 sceSifGetMainAddr(); /* * SBUS Sub CPU DMA receive address */ -u32 sceSifGetSubAddr(); -u32 sceSifSetSubAddr(u32 addr); +extern u32 sceSifGetSubAddr(); +extern u32 sceSifSetSubAddr(u32 addr); /* * Send a SBUS interrupt to the Main CPU */ -void sceSifIntrMain(); +extern void sceSifIntrMain(); -int sceSifCheckInit(); +extern int sceSifCheckInit(); -void sceSifSetDmaIntrHandler(void (*handler)(void *), void *arg); -void sceSifResetDmaIntrHandler(); +extern void sceSifSetDmaIntrHandler(void (*handler)(void *), void *arg); +extern void sceSifResetDmaIntrHandler(); -unsigned int sceSifSetDmaIntr(SifDmaTransfer_t *dmat, int count, void (*completioncb)(void *userdata), void *userdata); +extern unsigned int sceSifSetDmaIntr(SifDmaTransfer_t *dmat, int count, void (*completioncb)(void *userdata), void *userdata); #define sifman_IMPORTS_start DECLARE_IMPORT_TABLE(sifman, 1, 1) #define sifman_IMPORTS_end END_IMPORT_TABLE diff --git a/iop/kernel/include/sior.h b/iop/kernel/include/sior.h index 360a3021381..a1050722b0e 100644 --- a/iop/kernel/include/sior.h +++ b/iop/kernel/include/sior.h @@ -25,22 +25,22 @@ extern "C" { #endif -void sio_init(u32 baudrate, u8 lcr_ueps, u8 lcr_upen, u8 lcr_usbl, u8 lcr_umode); -int sio_putc(int c); -int sio_getc(void); -int sio_getc_block(void); +extern void sio_init(u32 baudrate, u8 lcr_ueps, u8 lcr_upen, u8 lcr_usbl, u8 lcr_umode); +extern int sio_putc(int c); +extern int sio_getc(void); +extern int sio_getc_block(void); -size_t sio_write(const char *buf, size_t size); -size_t sio_read(char *buf, size_t size); +extern size_t sio_write(const char *buf, size_t size); +extern size_t sio_read(char *buf, size_t size); -int sio_puts(const char *str); -int sio_putsn(const char *str); // no newline for this one -char *sio_gets(char *str); +extern int sio_puts(const char *str); +extern int sio_putsn(const char *str); // no newline for this one +extern char *sio_gets(char *str); -void sio_flush(void); +extern void sio_flush(void); -int sio_printf(const char *format, ...); -int sio_vprintf(const char *format, va_list); +extern int sio_printf(const char *format, ...); +extern int sio_vprintf(const char *format, va_list); #define sior_IMPORTS_start DECLARE_IMPORT_TABLE(sior, 1, 1) #define sior_IMPORTS_end END_IMPORT_TABLE diff --git a/iop/kernel/include/ssbusc.h b/iop/kernel/include/ssbusc.h index 584f3de1e87..d6a1b1a9075 100644 --- a/iop/kernel/include/ssbusc.h +++ b/iop/kernel/include/ssbusc.h @@ -185,24 +185,24 @@ ID - PS2 Function - PS Function - Address - Delay (Configuration) Common Delay register: 0xBF801020 */ //These functions control access configuration (i.e. window size and access cycles) and memory map of the devices. -int SetDelay(int device, unsigned int value); -int GetDelay(int device); -int SetBaseAddress(int device, unsigned int value); -int GetBaseAddress(int device); +extern int SetDelay(int device, unsigned int value); +extern int GetDelay(int device); +extern int SetBaseAddress(int device, unsigned int value); +extern int GetBaseAddress(int device); //Helper functions for getting/setting various fields within the common delay register. -int SetRecoveryTime(unsigned int value); -int GetRecoveryTime(void); -int SetHoldTime(unsigned int value); -int GetHoldTime(void); -int SetFloatTime(unsigned int value); -int GetFloatTime(void); -int SetStrobeTime(unsigned int value); -int GetStrobeTime(void); +extern int SetRecoveryTime(unsigned int value); +extern int GetRecoveryTime(void); +extern int SetHoldTime(unsigned int value); +extern int GetHoldTime(void); +extern int SetFloatTime(unsigned int value); +extern int GetFloatTime(void); +extern int SetStrobeTime(unsigned int value); +extern int GetStrobeTime(void); //Direct access to the common delay register. -int SetCommonDelay(unsigned int value); -int GetCommonDelay(void); +extern int SetCommonDelay(unsigned int value); +extern int GetCommonDelay(void); #define ssbusc_IMPORTS_start DECLARE_IMPORT_TABLE(ssbusc, 1, 1) #define ssbusc_IMPORTS_end END_IMPORT_TABLE diff --git a/iop/kernel/include/stdio.h b/iop/kernel/include/stdio.h index 2a89aee1cd0..9b4426ef57d 100644 --- a/iop/kernel/include/stdio.h +++ b/iop/kernel/include/stdio.h @@ -23,17 +23,17 @@ extern "C" { #endif -int printf(const char *format, ...); -int getchar(void); -int putchar(int c); -int puts(const char *s); -char *gets(char *s); -int fdprintf(int fd, const char *format, ...); -int fdgetc(int fd); -int fdputc(int c, int fd); -int fdputs(const char *s, int fd); -char *fdgets(char *buf, int fd); -int vfdprintf(int fd, const char *format, va_list ap); +extern int printf(const char *format, ...); +extern int getchar(void); +extern int putchar(int c); +extern int puts(const char *s); +extern char *gets(char *s); +extern int fdprintf(int fd, const char *format, ...); +extern int fdgetc(int fd); +extern int fdputc(int c, int fd); +extern int fdputs(const char *s, int fd); +extern char *fdgets(char *buf, int fd); +extern int vfdprintf(int fd, const char *format, va_list ap); #define stdio_IMPORTS_start DECLARE_IMPORT_TABLE(stdio, 1, 2) #define stdio_IMPORTS_end END_IMPORT_TABLE diff --git a/iop/kernel/include/sysclib.h b/iop/kernel/include/sysclib.h index 5ed96008f38..78049e5b640 100644 --- a/iop/kernel/include/sysclib.h +++ b/iop/kernel/include/sysclib.h @@ -31,56 +31,56 @@ typedef void (*print_callback_t)(void *context, int c); /* setjmp/longjmp are already defined in setjmp.h */ /* These functions are non-standardized (char instead of int) */ -char _toupper(char c); -char _tolower(char c); +extern char _toupper(char c); +extern char _tolower(char c); /* These functions are non-standardized (IOP-only functions operating on 32-bit integers instead of wchar_t) */ -void *_wmemcopy(u32 *dest, const u32 *src, size_t size); -void *_wmemset(u32 *dest, u32 c, size_t size); +extern void *_wmemcopy(u32 *dest, const u32 *src, size_t size); +extern void *_wmemset(u32 *dest, u32 c, size_t size); #ifdef SYSCLIB_ENABLE_NONSTD_WIDE_MEMCOPY #define wmemcopy _wmemcopy #define wmemset _wmemset #endif /* This function is non-standard. */ -int prnt(print_callback_t, void *context, const char * format, va_list ap); +extern int prnt(print_callback_t, void *context, const char * format, va_list ap); /* These functions are used in the process of ctype.h and is non-standard. */ -unsigned char look_ctype_table(char character); -void *get_ctype_table(); +extern unsigned char look_ctype_table(char character); +extern void *get_ctype_table(); /* This function is non-standard. */ -char *atob(char *s, int *i); - -void *memchr(const void *s, int c, size_t n); -int memcmp(const void *p, const void *q, size_t size); -void * memcpy(void *dest, const void *src, size_t size); -void *memmove(void *dest, const void *src, size_t size); -void * memset(void *ptr, int c, size_t size); -int bcmp(const void *, const void *, size_t); -void bcopy(const void *, void *, size_t); -void bzero(void *, size_t); -int sprintf(char *str, const char *format, ...); -char *strcat(char *dest, const char *src); -char *strchr(const char *s, int c); -int strcmp(const char *p, const char *q); -char *strcpy(char *dest, const char *src); -size_t strcspn(const char *s, const char *reject); -char *index(const char *s, int c); -char *rindex(const char *s, int c); -size_t strlen(const char *s); -char *strncat(char *dest, const char *src, size_t size); -int strncmp(const char *p, const char *q, size_t size); -char *strncpy(char *dest, const char *src, size_t size); -char *strpbrk(const char *s, const char *accept); -char *strrchr(const char *s, int c); -size_t strspn(const char *s, const char *accept); -char *strstr(const char *haystack, const char *needle); -char *strtok(char *s, const char *delim); -long strtol(const char *s, char **endptr, int base); -unsigned long strtoul(const char *s, char **endptr, int base); -int vsprintf(char *, const char *, va_list); -char *strtok_r(char *s, const char *delim, char **lasts); +extern char *atob(char *s, int *i); + +extern void *memchr(const void *s, int c, size_t n); +extern int memcmp(const void *p, const void *q, size_t size); +extern void * memcpy(void *dest, const void *src, size_t size); +extern void *memmove(void *dest, const void *src, size_t size); +extern void * memset(void *ptr, int c, size_t size); +extern int bcmp(const void *, const void *, size_t); +extern void bcopy(const void *, void *, size_t); +extern void bzero(void *, size_t); +extern int sprintf(char *str, const char *format, ...); +extern char *strcat(char *dest, const char *src); +extern char *strchr(const char *s, int c); +extern int strcmp(const char *p, const char *q); +extern char *strcpy(char *dest, const char *src); +extern size_t strcspn(const char *s, const char *reject); +extern char *index(const char *s, int c); +extern char *rindex(const char *s, int c); +extern size_t strlen(const char *s); +extern char *strncat(char *dest, const char *src, size_t size); +extern int strncmp(const char *p, const char *q, size_t size); +extern char *strncpy(char *dest, const char *src, size_t size); +extern char *strpbrk(const char *s, const char *accept); +extern char *strrchr(const char *s, int c); +extern size_t strspn(const char *s, const char *accept); +extern char *strstr(const char *haystack, const char *needle); +extern char *strtok(char *s, const char *delim); +extern long strtol(const char *s, char **endptr, int base); +extern unsigned long strtoul(const char *s, char **endptr, int base); +extern int vsprintf(char *, const char *, va_list); +extern char *strtok_r(char *s, const char *delim, char **lasts); #ifndef SYSCLIB_DISABLE_BUILTINS #ifndef memchr diff --git a/iop/kernel/include/sysmem.h b/iop/kernel/include/sysmem.h index dd2138dfb0a..e2b11216614 100644 --- a/iop/kernel/include/sysmem.h +++ b/iop/kernel/include/sysmem.h @@ -57,24 +57,24 @@ typedef struct sysmem_internals_ sysmem_alloc_table_t *smemupdate_cur; } sysmem_internals_t; -sysmem_internals_t *GetSysmemInternalData(void); +extern sysmem_internals_t *GetSysmemInternalData(void); -void * AllocSysMemory(int mode, int size, void *ptr); +extern void * AllocSysMemory(int mode, int size, void *ptr); -int FreeSysMemory(void *ptr); +extern int FreeSysMemory(void *ptr); -u32 QueryMemSize(); +extern u32 QueryMemSize(); // In liberx, the following is QueryFreeMemSize -u32 QueryMaxFreeMemSize(); -u32 QueryTotalFreeMemSize(); +extern u32 QueryMaxFreeMemSize(); +extern u32 QueryTotalFreeMemSize(); // In liberx, the following is QueryBlockInfo -void * QueryBlockTopAddress(void *address); -int QueryBlockSize(void *address); +extern void * QueryBlockTopAddress(void *address); +extern int QueryBlockSize(void *address); typedef int (KprintfHandler_t)(void *context, const char *format, va_list ap); -int Kprintf(const char *format,...); -void KprintfSet(KprintfHandler_t *, void *context); +extern int Kprintf(const char *format,...); +extern void KprintfSet(KprintfHandler_t *, void *context); #define sysmem_IMPORTS_start DECLARE_IMPORT_TABLE(sysmem, 1, 1) #define sysmem_IMPORTS_end END_IMPORT_TABLE diff --git a/iop/kernel/include/thbase.h b/iop/kernel/include/thbase.h index bb8b69da5e1..cdd2864dc73 100644 --- a/iop/kernel/include/thbase.h +++ b/iop/kernel/include/thbase.h @@ -114,56 +114,56 @@ typedef struct _iop_sys_status unsigned int reserved[8]; } iop_sys_status_t; -int CreateThread(iop_thread_t *thread); -int DeleteThread(int thid); +extern int CreateThread(iop_thread_t *thread); +extern int DeleteThread(int thid); -int StartThread(int thid, void *arg); -int StartThreadArgs(int thid, int args, void *argp); +extern int StartThread(int thid, void *arg); +extern int StartThreadArgs(int thid, int args, void *argp); -int ExitThread(); -int ExitDeleteThread(); -int TerminateThread(int thid); -int iTerminateThread(int thid); +extern int ExitThread(); +extern int ExitDeleteThread(); +extern int TerminateThread(int thid); +extern int iTerminateThread(int thid); -int DisableDispatchThread(void); -int EnableDispatchThread(void); +extern int DisableDispatchThread(void); +extern int EnableDispatchThread(void); -int ChangeThreadPriority(int thid, int priority); -int iChangeThreadPriority(int thid, int priority); +extern int ChangeThreadPriority(int thid, int priority); +extern int iChangeThreadPriority(int thid, int priority); -int RotateThreadReadyQueue(int priority); -int iRotateThreadReadyQueue(int priority); +extern int RotateThreadReadyQueue(int priority); +extern int iRotateThreadReadyQueue(int priority); -int ReleaseWaitThread(int thid); -int iReleaseWaitThread(int thid); +extern int ReleaseWaitThread(int thid); +extern int iReleaseWaitThread(int thid); -int GetThreadId(void); -int CheckThreadStack(void); -int ReferThreadStatus(int thid, iop_thread_info_t *info); -int iReferThreadStatus(int thid, iop_thread_info_t *info); +extern int GetThreadId(void); +extern int CheckThreadStack(void); +extern int ReferThreadStatus(int thid, iop_thread_info_t *info); +extern int iReferThreadStatus(int thid, iop_thread_info_t *info); -int SleepThread(void); -int WakeupThread(int thid); -int iWakeupThread(int thid); -int CancelWakeupThread(int thid); -int iCancelWakeupThread(int thid); +extern int SleepThread(void); +extern int WakeupThread(int thid); +extern int iWakeupThread(int thid); +extern int CancelWakeupThread(int thid); +extern int iCancelWakeupThread(int thid); -int SuspendThread(int thid); -int iSuspendThread(int thid); -int ResumeThread(int thid); -int iResumeThread(int thid); +extern int SuspendThread(int thid); +extern int iSuspendThread(int thid); +extern int ResumeThread(int thid); +extern int iResumeThread(int thid); -int DelayThread(int usec); +extern int DelayThread(int usec); -int GetSystemTime(iop_sys_clock_t *sys_clock); -int SetAlarm(iop_sys_clock_t *sys_clock, unsigned int (*alarm_cb)(void *), void *arg); -int iSetAlarm(iop_sys_clock_t *sys_clock, unsigned int (*alarm_cb)(void *), void *arg); -int CancelAlarm(unsigned int (*alarm_cb)(void *), void *arg); -int iCancelAlarm(unsigned int (*alarm_cb)(void *), void *arg); -void USec2SysClock(u32 usec, iop_sys_clock_t *sys_clock); -void SysClock2USec(iop_sys_clock_t *sys_clock, u32 *sec, u32 *usec); +extern int GetSystemTime(iop_sys_clock_t *sys_clock); +extern int SetAlarm(iop_sys_clock_t *sys_clock, unsigned int (*alarm_cb)(void *), void *arg); +extern int iSetAlarm(iop_sys_clock_t *sys_clock, unsigned int (*alarm_cb)(void *), void *arg); +extern int CancelAlarm(unsigned int (*alarm_cb)(void *), void *arg); +extern int iCancelAlarm(unsigned int (*alarm_cb)(void *), void *arg); +extern void USec2SysClock(u32 usec, iop_sys_clock_t *sys_clock); +extern void SysClock2USec(iop_sys_clock_t *sys_clock, u32 *sec, u32 *usec); -int GetSystemStatusFlag(); +extern int GetSystemStatusFlag(); // clang-format off #define thbase_IMPORTS \ diff --git a/iop/kernel/include/thevent.h b/iop/kernel/include/thevent.h index f22242ac77b..38beee98a79 100644 --- a/iop/kernel/include/thevent.h +++ b/iop/kernel/include/thevent.h @@ -57,21 +57,21 @@ typedef struct int reserved2; } iop_event_info_t; -int CreateEventFlag(iop_event_t *event); -int DeleteEventFlag(int ef); +extern int CreateEventFlag(iop_event_t *event); +extern int DeleteEventFlag(int ef); -int SetEventFlag(int ef, u32 bits); -int iSetEventFlag(int ef, u32 bits); +extern int SetEventFlag(int ef, u32 bits); +extern int iSetEventFlag(int ef, u32 bits); -int ClearEventFlag(int ef, u32 bits); -int iClearEventFlag(int ef, u32 bits); +extern int ClearEventFlag(int ef, u32 bits); +extern int iClearEventFlag(int ef, u32 bits); -int WaitEventFlag(int ef, u32 bits, int mode, u32 *resbits); +extern int WaitEventFlag(int ef, u32 bits, int mode, u32 *resbits); -int PollEventFlag(int ef, u32 bits, int mode, u32 *resbits); +extern int PollEventFlag(int ef, u32 bits, int mode, u32 *resbits); -int ReferEventFlagStatus(int ef, iop_event_info_t *info); -int iReferEventFlagStatus(int ef, iop_event_info_t *info); +extern int ReferEventFlagStatus(int ef, iop_event_info_t *info); +extern int iReferEventFlagStatus(int ef, iop_event_info_t *info); // clang-format off #define thevent_IMPORTS \ diff --git a/iop/kernel/include/thmsgbx.h b/iop/kernel/include/thmsgbx.h index 27774077f13..36297b272e9 100644 --- a/iop/kernel/include/thmsgbx.h +++ b/iop/kernel/include/thmsgbx.h @@ -65,16 +65,16 @@ typedef struct _iop_mbx_status int reserved[2]; } iop_mbx_status_t; -int CreateMbx(iop_mbx_t *mbx); -int DeleteMbx(int mbxid); +extern int CreateMbx(iop_mbx_t *mbx); +extern int DeleteMbx(int mbxid); -int SendMbx(int mbxid, void *msg); -int iSendMbx(int mbxid, void *msg); -int ReceiveMbx(void **msgvar, int mbxid); -int PollMbx(void **msgvar, int mbxid); +extern int SendMbx(int mbxid, void *msg); +extern int iSendMbx(int mbxid, void *msg); +extern int ReceiveMbx(void **msgvar, int mbxid); +extern int PollMbx(void **msgvar, int mbxid); -int ReferMbxStatus(int mbxid, iop_mbx_status_t *info); -int iReferMbxStatus(int mbxid, iop_mbx_status_t *info); +extern int ReferMbxStatus(int mbxid, iop_mbx_status_t *info); +extern int iReferMbxStatus(int mbxid, iop_mbx_status_t *info); #define thmsgbx_IMPORTS_start DECLARE_IMPORT_TABLE(thmsgbx, 1, 1) #define thmsgbx_IMPORTS_end END_IMPORT_TABLE diff --git a/iop/kernel/include/thpool.h b/iop/kernel/include/thpool.h index 8b8de8d692e..c47fb64642f 100644 --- a/iop/kernel/include/thpool.h +++ b/iop/kernel/include/thpool.h @@ -51,14 +51,14 @@ typedef struct _iop_fpl_info int reserved[4]; } iop_fpl_info_t; -int CreateFpl(iop_fpl_param *param); -int DeleteFpl(int fplId); -void *AllocateFpl(int fplId); -void *pAllocateFpl(int fplId); -void *ipAllocateFpl(int fplId); -int FreeFpl(int fplId, void *memory); -int ReferFplStatus(int fplId, iop_fpl_info_t *info); -int iReferFplStatus(int fplId, iop_fpl_info_t *info); +extern int CreateFpl(iop_fpl_param *param); +extern int DeleteFpl(int fplId); +extern void *AllocateFpl(int fplId); +extern void *pAllocateFpl(int fplId); +extern void *ipAllocateFpl(int fplId); +extern int FreeFpl(int fplId, void *memory); +extern int ReferFplStatus(int fplId, iop_fpl_info_t *info); +extern int iReferFplStatus(int fplId, iop_fpl_info_t *info); #define thfpool_IMPORTS_start DECLARE_IMPORT_TABLE(thfpool, 1, 1) #define thfpool_IMPORTS_end END_IMPORT_TABLE @@ -98,14 +98,14 @@ typedef struct _iop_vpl_info int reserved[3]; } iop_vpl_info_t; -int CreateVpl(iop_vpl_param *param); -int DeleteVpl(int vplId); -void *AllocateVpl(int vplId, int size); -void *pAllocateVpl(int vplId, int size); -void *ipAllocateVpl(int vplId, int size); -int FreeVpl(int vplId, void *memory); -int ReferVplStatus(int vplId, iop_vpl_info_t *info); -int iReferVplStatus(int vplId, iop_vpl_info_t *info); +extern int CreateVpl(iop_vpl_param *param); +extern int DeleteVpl(int vplId); +extern void *AllocateVpl(int vplId, int size); +extern void *pAllocateVpl(int vplId, int size); +extern void *ipAllocateVpl(int vplId, int size); +extern int FreeVpl(int vplId, void *memory); +extern int ReferVplStatus(int vplId, iop_vpl_info_t *info); +extern int iReferVplStatus(int vplId, iop_vpl_info_t *info); #define thvpool_IMPORTS_start DECLARE_IMPORT_TABLE(thvpool, 1, 1) #define thvpool_IMPORTS_end END_IMPORT_TABLE diff --git a/iop/kernel/include/thsemap.h b/iop/kernel/include/thsemap.h index 04619260037..961ebd1c920 100644 --- a/iop/kernel/include/thsemap.h +++ b/iop/kernel/include/thsemap.h @@ -54,16 +54,16 @@ typedef struct int reserved[2]; } iop_sema_info_t; -int CreateSema(iop_sema_t *sema); -int DeleteSema(int semid); +extern int CreateSema(iop_sema_t *sema); +extern int DeleteSema(int semid); -int SignalSema(int semid); -int iSignalSema(int semid); -int WaitSema(int semid); -int PollSema(int semid); +extern int SignalSema(int semid); +extern int iSignalSema(int semid); +extern int WaitSema(int semid); +extern int PollSema(int semid); -int ReferSemaStatus(int semid, iop_sema_info_t *info); -int iReferSemaStatus(int semid, iop_sema_info_t *info); +extern int ReferSemaStatus(int semid, iop_sema_info_t *info); +extern int iReferSemaStatus(int semid, iop_sema_info_t *info); #define IOP_MUTEX_LOCKED 0 #define IOP_MUTEX_UNLOCKED 1 diff --git a/iop/kernel/include/timrman.h b/iop/kernel/include/timrman.h index d3e54d1d1e3..8923b1c2fe1 100644 --- a/iop/kernel/include/timrman.h +++ b/iop/kernel/include/timrman.h @@ -65,32 +65,32 @@ extern "C" { RTC4 SYSCLOCK None 32 256 RTC5 SYSCLOCK None 32 256 */ -void *GetTimersTable(); +extern void *GetTimersTable(); -int AllocHardTimer(int source, int size, int prescale); -int ReferHardTimer(int source, int size, int mode, int modemask); -int FreeHardTimer(int timid); +extern int AllocHardTimer(int source, int size, int prescale); +extern int ReferHardTimer(int source, int size, int mode, int modemask); +extern int FreeHardTimer(int timid); -void SetTimerMode(int timid, int mode); +extern void SetTimerMode(int timid, int mode); -u32 GetTimerStatus(int timid); +extern u32 GetTimerStatus(int timid); -void SetTimerCounter(int timid, u32 count); -u32 GetTimerCounter(int timid); +extern void SetTimerCounter(int timid, u32 count); +extern u32 GetTimerCounter(int timid); -void SetTimerCompare(int timid, u32 compare); -u32 GetTimerCompare(int timid); +extern void SetTimerCompare(int timid, u32 compare); +extern u32 GetTimerCompare(int timid); -void SetHoldMode(int holdnum, int mode); -u32 GetHoldMode(int holdnum); +extern void SetHoldMode(int holdnum, int mode); +extern u32 GetHoldMode(int holdnum); -u32 GetHoldReg(int holdnum); +extern u32 GetHoldReg(int holdnum); -int GetHardTimerIntrCode(int timid); +extern int GetHardTimerIntrCode(int timid); // guessed name -u32 GetTimerMode(int timid); -u32 (*GetTimerReadFunc(int timid))(); +extern u32 GetTimerMode(int timid); +extern u32 (*GetTimerReadFunc(int timid))(); // clang-format off #define timrman_IMPORTS \ diff --git a/iop/kernel/include/vblank.h b/iop/kernel/include/vblank.h index 8b69ac92160..59df70ef468 100644 --- a/iop/kernel/include/vblank.h +++ b/iop/kernel/include/vblank.h @@ -46,16 +46,16 @@ typedef struct vblank_internals_ vblank_item_t list_items[16]; } vblank_internals_t; -vblank_internals_t *GetVblankInternalData(void); +extern vblank_internals_t *GetVblankInternalData(void); -void WaitVblankStart(); -void WaitVblankEnd(); -void WaitVblank(); -void WaitNonVblank(); +extern void WaitVblankStart(); +extern void WaitVblankEnd(); +extern void WaitVblank(); +extern void WaitNonVblank(); -int RegisterVblankHandler(int startend, int priority, int (*handler)(void *), - void *arg); -int ReleaseVblankHandler(int startend, int (*handler)(void *)); +extern int RegisterVblankHandler(int startend, int priority, int (*handler)(void *), + void *arg); +extern int ReleaseVblankHandler(int startend, int (*handler)(void *)); #define vblank_IMPORTS_start DECLARE_IMPORT_TABLE(vblank, 1, 1) #define vblank_IMPORTS_end END_IMPORT_TABLE diff --git a/iop/kernel/include/xloadcore.h b/iop/kernel/include/xloadcore.h index 3b30645620a..86b3ed278a6 100644 --- a/iop/kernel/include/xloadcore.h +++ b/iop/kernel/include/xloadcore.h @@ -25,9 +25,9 @@ extern "C" { #define xloadcore_IMPORTS_start DECLARE_IMPORT_TABLE(loadcore, 1, 3) #define xloadcore_IMPORTS_end END_IMPORT_TABLE -void ApplyElfRelSection(void *buffer, const void *module, int element_count); -void CopyModInfo(FileInfo_t *ModuleInfo, ModuleInfo_t *ModInfo); -int SetRebootTimeLibraryHandlingMode(struct irx_export_table *exports, int mode); +extern void ApplyElfRelSection(void *buffer, const void *module, int element_count); +extern void CopyModInfo(FileInfo_t *ModuleInfo, ModuleInfo_t *ModInfo); +extern int SetRebootTimeLibraryHandlingMode(struct irx_export_table *exports, int mode); #define I_ApplyElfRelSection DECLARE_IMPORT(25, ApplyElfRelSection) #define I_CopyModInfo DECLARE_IMPORT(26, CopyModInfo) diff --git a/iop/kernel/include/xmodload.h b/iop/kernel/include/xmodload.h index 04bc7feacea..17da5dd7b63 100644 --- a/iop/kernel/include/xmodload.h +++ b/iop/kernel/include/xmodload.h @@ -22,7 +22,7 @@ extern "C" { #endif -int GetModuleIdList(int *readbuf, int readbufsize, int *modulecount); +extern int GetModuleIdList(int *readbuf, int readbufsize, int *modulecount); typedef struct { char name[56]; @@ -38,8 +38,8 @@ typedef struct { u32 lreserve[2]; } ModuleStatus; -int ReferModuleStatus(int modid, ModuleStatus *status); -int GetModuleIdListByName(const char *name, int *readbuf, int readbufsize, int *modulecount); +extern int ReferModuleStatus(int modid, ModuleStatus *status); +extern int GetModuleIdListByName(const char *name, int *readbuf, int readbufsize, int *modulecount); typedef struct { int (*beforeOpen)(void *opt, const char *filename, int flag); @@ -63,16 +63,16 @@ typedef struct { int ireserved[3]; } LMWOoption; -int LoadModuleWithOption(const char *filename, const LMWOoption *option); -int StopModule(int modid, int arglen, const char *args, int *result); -int UnloadModule(int modid); -int SearchModuleByName(const char *name); -int SearchModuleByAddress(const void *addr); -int SelfStopModule(int arglen, const char *args, int *result); -void SelfUnloadModule(void); -void *AllocLoadMemory(int type, unsigned int size, void *addr); -int FreeLoadMemory(void *area); -int SetModuleFlags(int modid, int flag); +extern int LoadModuleWithOption(const char *filename, const LMWOoption *option); +extern int StopModule(int modid, int arglen, const char *args, int *result); +extern int UnloadModule(int modid); +extern int SearchModuleByName(const char *name); +extern int SearchModuleByAddress(const void *addr); +extern int SelfStopModule(int arglen, const char *args, int *result); +extern void SelfUnloadModule(void); +extern void *AllocLoadMemory(int type, unsigned int size, void *addr); +extern int FreeLoadMemory(void *area); +extern int SetModuleFlags(int modid, int flag); #define xmodload_IMPORTS_start DECLARE_IMPORT_TABLE(modload, 1, 7) #define xmodload_IMPORTS_end END_IMPORT_TABLE diff --git a/iop/kernel/include/xmtapman.h b/iop/kernel/include/xmtapman.h index 0ea6c30a7e7..632c333a323 100644 --- a/iop/kernel/include/xmtapman.h +++ b/iop/kernel/include/xmtapman.h @@ -13,10 +13,10 @@ extern "C" { #endif -s32 mtapPortOpen(u32 port); -s32 mtapPortClose(u32 port); -s32 mtapGetSlotNumber(u32 port); -s32 mtapChangeSlot(u32 port, u32 slot); +extern s32 mtapPortOpen(u32 port); +extern s32 mtapPortClose(u32 port); +extern s32 mtapGetSlotNumber(u32 port); +extern s32 mtapChangeSlot(u32 port, u32 slot); #define xmtapman_IMPORTS_start DECLARE_IMPORT_TABLE(mtapman, 1, 2) #define xmtapman_IMPORTS_end END_IMPORT_TABLE diff --git a/iop/kernel/include/xpadman.h b/iop/kernel/include/xpadman.h index 443d853c766..590a84b3e83 100644 --- a/iop/kernel/include/xpadman.h +++ b/iop/kernel/include/xpadman.h @@ -13,21 +13,21 @@ extern "C" { #endif -s32 padInit(void * ee_addr); -s32 padEnd(); -s32 padPortClose(s32 port, s32 slot, s32 wait); -s32 padPortOpen(s32 port, s32 slot, s32 pad_area_ee_addr, u32 *buf); -u32 padGetInBuffer(u32 port, u32 slot, u8 *buf); -u32 padSetupEEButtonData(u32 port, u32 slot, void *pstate); -u32 padGetModeConfig(u32 port, u32 slot); -u32 padSetMainMode(u32 port, u32 slot, u32 mode, u32 lock); -u32 padSetActDirect(u32 port, u32 slot, u8 *actData); -u32 padSetActAlign(u32 port, u32 slot, const u8 *actData); -u32 padGetButtonMask(u32 port, u32 slot); -u32 padSetButtonInfo(u32 port, u32 slot, u32 info); -s32 padInfoAct(u32 port, u32 slot, s32 act, u32 val); -s32 padInfoComb(u32 port, u32 slot, s32 val1, u32 val2); -s32 padInfoMode(u32 port, u32 slot, s32 val1, u32 val2); +extern s32 padInit(void * ee_addr); +extern s32 padEnd(); +extern s32 padPortClose(s32 port, s32 slot, s32 wait); +extern s32 padPortOpen(s32 port, s32 slot, s32 pad_area_ee_addr, u32 *buf); +extern u32 padGetInBuffer(u32 port, u32 slot, u8 *buf); +extern u32 padSetupEEButtonData(u32 port, u32 slot, void *pstate); +extern u32 padGetModeConfig(u32 port, u32 slot); +extern u32 padSetMainMode(u32 port, u32 slot, u32 mode, u32 lock); +extern u32 padSetActDirect(u32 port, u32 slot, u8 *actData); +extern u32 padSetActAlign(u32 port, u32 slot, const u8 *actData); +extern u32 padGetButtonMask(u32 port, u32 slot); +extern u32 padSetButtonInfo(u32 port, u32 slot, u32 info); +extern s32 padInfoAct(u32 port, u32 slot, s32 act, u32 val); +extern s32 padInfoComb(u32 port, u32 slot, s32 val1, u32 val2); +extern s32 padInfoMode(u32 port, u32 slot, s32 val1, u32 val2); #define xpadman_IMPORTS_start DECLARE_IMPORT_TABLE(padman, 1, 2) #define xpadman_IMPORTS_end END_IMPORT_TABLE diff --git a/iop/kernel/include/xsio2man.h b/iop/kernel/include/xsio2man.h index 566732210e2..189c7ca28cc 100644 --- a/iop/kernel/include/xsio2man.h +++ b/iop/kernel/include/xsio2man.h @@ -27,18 +27,18 @@ typedef int (*sio2_mtap_get_slot_max_cb_t)(int port); typedef int (*sio2_mtap_get_slot_max2_cb_t)(int port); typedef void (*sio2_mtap_update_slots_t)(void); -void sio2_transfer_reset(void); -void sio2_mtap_transfer_init(void); -int sio2_transfer2(sio2_transfer_data_t *td); -void sio2_transfer_reset2(void); -void sio2_mtap_change_slot_set(sio2_mtap_change_slot_cb_t cb); -void sio2_mtap_get_slot_max_set(sio2_mtap_get_slot_max_cb_t cb); -void sio2_mtap_get_slot_max2_set(sio2_mtap_get_slot_max2_cb_t cb); -void sio2_mtap_update_slots_set(sio2_mtap_update_slots_t cb); -int sio2_mtap_change_slot(s32 *arg); -int sio2_mtap_get_slot_max(int port); -int sio2_mtap_get_slot_max2(int port); -void sio2_mtap_update_slots(void); +extern void sio2_transfer_reset(void); +extern void sio2_mtap_transfer_init(void); +extern int sio2_transfer2(sio2_transfer_data_t *td); +extern void sio2_transfer_reset2(void); +extern void sio2_mtap_change_slot_set(sio2_mtap_change_slot_cb_t cb); +extern void sio2_mtap_get_slot_max_set(sio2_mtap_get_slot_max_cb_t cb); +extern void sio2_mtap_get_slot_max2_set(sio2_mtap_get_slot_max2_cb_t cb); +extern void sio2_mtap_update_slots_set(sio2_mtap_update_slots_t cb); +extern int sio2_mtap_change_slot(s32 *arg); +extern int sio2_mtap_get_slot_max(int port); +extern int sio2_mtap_get_slot_max2(int port); +extern void sio2_mtap_update_slots(void); #define xsio2man_IMPORTS_start DECLARE_IMPORT_TABLE(sio2man, 1, 2) #define xsio2man_IMPORTS_end END_IMPORT_TABLE diff --git a/iop/kernel/include/xsysmem.h b/iop/kernel/include/xsysmem.h index 7089fc0e17d..712a66e5260 100644 --- a/iop/kernel/include/xsysmem.h +++ b/iop/kernel/include/xsysmem.h @@ -51,7 +51,7 @@ typedef union sysmem_info_ sysmem_meminfo_t meminfo; /* when flag of GetSysMemoryInfo is nonzero */ } sysmem_info_t; -void GetSysMemoryInfo(int flag, sysmem_info_t *info); +extern void GetSysMemoryInfo(int flag, sysmem_info_t *info); #define I_GetSysMemoryInfo DECLARE_IMPORT(11, GetSysMemoryInfo) diff --git a/iop/kernel/include/xthbase.h b/iop/kernel/include/xthbase.h index 97a2d65a604..613c3b00493 100644 --- a/iop/kernel/include/xthbase.h +++ b/iop/kernel/include/xthbase.h @@ -26,11 +26,11 @@ extern "C" { #define TSS_DISABLEINTR 3 #define TSS_NOTHREAD 4 -int GetThreadCurrentPriority(void); -unsigned int GetSystemTimeLow(void); -int ReferSystemStatus(iop_sys_status_t *info, size_t size); -int ReferThreadRunStatus(int thid, iop_thread_run_status_t *stat, size_t size); -int GetThreadStackFreeSize(int thid); +extern int GetThreadCurrentPriority(void); +extern unsigned int GetSystemTimeLow(void); +extern int ReferSystemStatus(iop_sys_status_t *info, size_t size); +extern int ReferThreadRunStatus(int thid, iop_thread_run_status_t *stat, size_t size); +extern int GetThreadStackFreeSize(int thid); // Type argument for GetThreadmanIdList #define TMID_Thread 1 @@ -43,7 +43,7 @@ int GetThreadStackFreeSize(int thid); #define TMID_DelayThread 8 #define TMID_DormantThread 9 -int GetThreadmanIdList(int type, int *readbuf, int readbufsize, int *objectcount); +extern int GetThreadmanIdList(int type, int *readbuf, int readbufsize, int *objectcount); #define xthbase_IMPORTS_start DECLARE_IMPORT_TABLE(thbase, 1, 1) #define xthbase_IMPORTS_end END_IMPORT_TABLE diff --git a/iop/kernel/include/xtimrman.h b/iop/kernel/include/xtimrman.h index 0aa1ebc0be0..fb9ebf0fc47 100644 --- a/iop/kernel/include/xtimrman.h +++ b/iop/kernel/include/xtimrman.h @@ -26,11 +26,11 @@ extern "C" { #define TC_PIXEL 2 #define TC_HLINE 4 -int SetTimerHandler(int timid, unsigned long comparevalue, unsigned int (*timeuphandler)(void *), void *common); -int SetOverflowHandler(int timid, unsigned int (*handler)(void *), void *common); -int SetupHardTimer(int timid, int source, int mode, int prescale); -int StartHardTimer(int timid); -int StopHardTimer(int timid); +extern int SetTimerHandler(int timid, unsigned long comparevalue, unsigned int (*timeuphandler)(void *), void *common); +extern int SetOverflowHandler(int timid, unsigned int (*handler)(void *), void *common); +extern int SetupHardTimer(int timid, int source, int mode, int prescale); +extern int StartHardTimer(int timid); +extern int StopHardTimer(int timid); #define xtimrman_IMPORTS_start DECLARE_IMPORT_TABLE(timrman, 1, 1) #define xtimrman_IMPORTS_end END_IMPORT_TABLE diff --git a/iop/memorycard/mcman/include/mcman.h b/iop/memorycard/mcman/include/mcman.h index 9e93ff60361..2c514b3e7cc 100644 --- a/iop/memorycard/mcman/include/mcman.h +++ b/iop/memorycard/mcman/include/mcman.h @@ -32,50 +32,50 @@ typedef struct _sceMcTblGetDir { // size = 64 char EntryName[32]; // 32 } sceMcTblGetDir; -int McDetectCard(int port, int slot); -int McOpen(int port, int slot, const char *filename, int flags); -int McClose(int fd); -int McRead(int fd, void *buf, int length); -int McWrite(int fd, void *buf, int length); -int McSeek(int fd, int offset, int origin); -int McFormat(int port, int slot); -int McGetDir(int port, int slot, const char *dirname, int flags, int maxent, sceMcTblGetDir *info); -int McDelete(int port, int slot, const char *filename, int flags); -int McFlush(int fd); -int McChDir(int port, int slot, const char *newdir, char *currentdir); -int McSetFileInfo(int port, int slot, const char *filename, sceMcTblGetDir *info, int flags); -int McEraseBlock(int port, int block, void **pagebuf, void *eccbuf); //MCMAN v1.1 does not have a slot argument -int McReadPage(int port, int slot, int page, void *buf); -int McWritePage(int port, int slot, int page, void *pagebuf, void *eccbuf); -void McDataChecksum(void *buf, void *ecc); -int McReadPS1PDACard(int port, int slot, int page, void *buf); -int McWritePS1PDACard(int port, int slot, int page, void *buf); -int McUnformat(int port, int slot); -int McRetOnly(int fd); -int McGetFreeClusters(int port, int slot); -int McGetMcType(int port, int slot); -void McSetPS1CardFlag(int flag); +extern int McDetectCard(int port, int slot); +extern int McOpen(int port, int slot, const char *filename, int flags); +extern int McClose(int fd); +extern int McRead(int fd, void *buf, int length); +extern int McWrite(int fd, void *buf, int length); +extern int McSeek(int fd, int offset, int origin); +extern int McFormat(int port, int slot); +extern int McGetDir(int port, int slot, const char *dirname, int flags, int maxent, sceMcTblGetDir *info); +extern int McDelete(int port, int slot, const char *filename, int flags); +extern int McFlush(int fd); +extern int McChDir(int port, int slot, const char *newdir, char *currentdir); +extern int McSetFileInfo(int port, int slot, const char *filename, sceMcTblGetDir *info, int flags); +extern int McEraseBlock(int port, int block, void **pagebuf, void *eccbuf); //MCMAN v1.1 does not have a slot argument +extern int McReadPage(int port, int slot, int page, void *buf); +extern int McWritePage(int port, int slot, int page, void *pagebuf, void *eccbuf); +extern void McDataChecksum(void *buf, void *ecc); +extern int McReadPS1PDACard(int port, int slot, int page, void *buf); +extern int McWritePS1PDACard(int port, int slot, int page, void *buf); +extern int McUnformat(int port, int slot); +extern int McRetOnly(int fd); +extern int McGetFreeClusters(int port, int slot); +extern int McGetMcType(int port, int slot); +extern void McSetPS1CardFlag(int flag); /* Available in XMCMAN only */ -int McEraseBlock2(int port, int slot, int block, void **pagebuf, void *eccbuf); -int McDetectCard2(int port, int slot); -int McGetFormat(int port, int slot); -int McGetEntSpace(int port, int slot, const char *dirname); -int McReplaceBadBlock(void); -int McCloseAll(void); +extern int McEraseBlock2(int port, int slot, int block, void **pagebuf, void *eccbuf); +extern int McDetectCard2(int port, int slot); +extern int McGetFormat(int port, int slot); +extern int McGetEntSpace(int port, int slot, const char *dirname); +extern int McReplaceBadBlock(void); +extern int McCloseAll(void); #ifdef _IOP -struct irx_id *McGetModuleInfo(void); +extern struct irx_id *McGetModuleInfo(void); #endif -int McGetCardSpec(int port, int slot, s16 *pagesize, u16 *blocksize, int *cardsize, u8 *flags); -int McGetFATentry(int port, int slot, int fat_index, int *fat_entry); -int McCheckBlock(int port, int slot, int block); -int McSetFATentry(int port, int slot, int fat_index, int fat_entry); -int McReadDirEntry(int port, int slot, int cluster, int fsindex, McFsEntry **pfse); -void Mc1stCacheEntSetWrFlagOff(void); -int McCreateDirentry(int port, int slot, int parent_cluster, int num_entries, int cluster, const sceMcStDateTime *ctime); -int McReadCluster(int port, int slot, int cluster, McCacheEntry **pmce); -int McFlushCache(int port, int slot); -int McSetDirEntryState(int port, int slot, int cluster, int fsindex, int flags); +extern int McGetCardSpec(int port, int slot, s16 *pagesize, u16 *blocksize, int *cardsize, u8 *flags); +extern int McGetFATentry(int port, int slot, int fat_index, int *fat_entry); +extern int McCheckBlock(int port, int slot, int block); +extern int McSetFATentry(int port, int slot, int fat_index, int fat_entry); +extern int McReadDirEntry(int port, int slot, int cluster, int fsindex, McFsEntry **pfse); +extern void Mc1stCacheEntSetWrFlagOff(void); +extern int McCreateDirentry(int port, int slot, int parent_cluster, int num_entries, int cluster, const sceMcStDateTime *ctime); +extern int McReadCluster(int port, int slot, int cluster, McCacheEntry **pmce); +extern int McFlushCache(int port, int slot); +extern int McSetDirEntryState(int port, int slot, int cluster, int fsindex, int flags); #define xfromman_IMPORTS_start DECLARE_IMPORT_TABLE(xfromman, 2, 3) #define xfromman_IMPORTS_end END_IMPORT_TABLE diff --git a/iop/memorycard/mcman/src/mcman-internal.h b/iop/memorycard/mcman/src/mcman-internal.h index f70445326d3..52eec493af6 100644 --- a/iop/memorycard/mcman/src/mcman-internal.h +++ b/iop/memorycard/mcman/src/mcman-internal.h @@ -182,112 +182,112 @@ typedef struct { // size = 48 // internal functions prototypes #if !defined(BUILDING_XFROMMAN) && !defined(BUILDING_VMCMAN) -int mcsio2_transfer(int port, int slot, sio2_transfer_data_t *sio2data); +extern int mcsio2_transfer(int port, int slot, sio2_transfer_data_t *sio2data); #endif -void long_multiply(u32 v1, u32 v2, u32 *HI, u32 *LO); -int mcman_chrpos(const char *str, int chr); -void mcman_wmemset(void *buf, int size, int value); -int mcman_calcEDC(void *buf, int size); -int mcman_checkpath(const char *str); -int mcman_checkdirpath(const char *str1, const char *str2); -void mcman_invhandles(int port, int slot); -int McCloseAll(void); -int mcman_detectcard(int port, int slot); -int mcman_dread(int fd, MC_IO_DRE_T *dirent); -int mcman_getstat(int port, int slot, const char *filename, MC_IO_STA_T *stat); -int mcman_getmcrtime(sceMcStDateTime *tm); -void mcman_initPS2com(void); -void mcman_deinitPS2com(void); +extern void long_multiply(u32 v1, u32 v2, u32 *HI, u32 *LO); +extern int mcman_chrpos(const char *str, int chr); +extern void mcman_wmemset(void *buf, int size, int value); +extern int mcman_calcEDC(void *buf, int size); +extern int mcman_checkpath(const char *str); +extern int mcman_checkdirpath(const char *str1, const char *str2); +extern void mcman_invhandles(int port, int slot); +extern int McCloseAll(void); +extern int mcman_detectcard(int port, int slot); +extern int mcman_dread(int fd, MC_IO_DRE_T *dirent); +extern int mcman_getstat(int port, int slot, const char *filename, MC_IO_STA_T *stat); +extern int mcman_getmcrtime(sceMcStDateTime *tm); +extern void mcman_initPS2com(void); +extern void mcman_deinitPS2com(void); #if !defined(BUILDING_XFROMMAN) && !defined(BUILDING_VMCMAN) -void sio2packet_add(int port, int slot, int cmd, u8 *buf); +extern void sio2packet_add(int port, int slot, int cmd, u8 *buf); #endif -int mcman_eraseblock(int port, int slot, int block, void **pagebuf, void *eccbuf); -int mcman_readpage(int port, int slot, int page, void *buf, void *eccbuf); -int mcman_cardchanged(int port, int slot); -int mcman_resetauth(int port, int slot); -int mcman_probePS2Card2(int port, int slot); -int mcman_probePS2Card(int port, int slot); +extern int mcman_eraseblock(int port, int slot, int block, void **pagebuf, void *eccbuf); +extern int mcman_readpage(int port, int slot, int page, void *buf, void *eccbuf); +extern int mcman_cardchanged(int port, int slot); +extern int mcman_resetauth(int port, int slot); +extern int mcman_probePS2Card2(int port, int slot); +extern int mcman_probePS2Card(int port, int slot); #if !defined(BUILDING_XFROMMAN) && !defined(BUILDING_VMCMAN) -int secrman_mc_command(int port, int slot, sio2_transfer_data_t *sio2data); +extern int secrman_mc_command(int port, int slot, sio2_transfer_data_t *sio2data); #endif -int mcman_getcnum (int port, int slot); -int mcman_correctdata(void *buf, void *ecc); -int mcman_sparesize(int port, int slot); -int mcman_setdevspec(int port, int slot); -int mcman_reportBadBlocks(int port, int slot); -int mcman_setdevinfos(int port, int slot); -int mcman_format2(int port, int slot); -int mcman_fatRseek(int fd); -int mcman_fatWseek(int fd); -int mcman_findfree2(int port, int slot, int reserve); -int mcman_dread2(int fd, MC_IO_DRE_T *dirent); -int mcman_getstat2(int port, int slot, const char *filename, MC_IO_STA_T *stat); -int mcman_setinfo2(int port, int slot, const char *filename, sceMcTblGetDir *info, int flags); -int mcman_read2(int fd, void *buffer, int nbyte); -int mcman_write2(int fd, void *buffer, int nbyte); -int mcman_close2(int fd); -int mcman_getentspace(int port, int slot, const char *dirname); -int mcman_cachedirentry(int port, int slot, const char *filename, McCacheDir *pcacheDir, McFsEntry **pfse, int unknown_flag); -int mcman_getdirinfo(int port, int slot, McFsEntry *pfse, const char *filename, McCacheDir *pcd, int unknown_flag); -int mcman_open2(int port, int slot, const char *filename, int flags); -int mcman_chdir(int port, int slot, const char *newdir, char *currentdir); -int mcman_writecluster(int port, int slot, int cluster, int flag); -int mcman_getdir2(int port, int slot, const char *dirname, int flags, int maxent, sceMcTblGetDir *info); -int mcman_delete2(int port, int slot, const char *filename, int flags); -int mcman_checkBackupBlocks(int port, int slot); -int mcman_unformat2(int port, int slot); -void mcman_initPS1PDAcom(void); -void mcman_deinitPS1PDAcom(void); -int mcman_probePS1Card2(int port, int slot); -int mcman_probePS1Card(int port, int slot); -int mcman_probePDACard(int port, int slot); -int mcman_setPS1devinfos(int port, int slot); -int mcman_format1(int port, int slot); -int mcman_open1(int port, int slot, const char *filename, int flags); -int mcman_read1(int fd, void *buffer, int nbyte); -int mcman_write1(int fd, void *buffer, int nbyte); -int mcman_getPS1direntry(int port, int slot, const char *filename, McFsEntryPS1 **pfse, int flag); -int mcman_dread1(int fd, MC_IO_DRE_T *dirent); -int mcman_getstat1(int port, int slot, const char *filename, MC_IO_STA_T *stat); -int mcman_setinfo1(int port, int slot, const char *filename, sceMcTblGetDir *info, int flags); -int mcman_getdir1(int port, int slot, const char *dirname, int flags, int maxent, sceMcTblGetDir *info); -int mcman_clearPS1direntry(int port, int slot, int cluster, int flags); -int mcman_delete1(int port, int slot, const char *filename, int flags); -int mcman_close1(int fd); -int mcman_findfree1(int port, int slot, int reserve); -int mcman_fatRseekPS1(int fd); -int mcman_fatWseekPS1(int fd); -int mcman_FNC8ca4(int port, int slot, MC_FHANDLE *fh); -int mcman_PS1pagetest(int port, int slot, int page); -int mcman_unformat1(int port, int slot); -int mcman_cachePS1dirs(int port, int slot); -int mcman_fillPS1backuparea(int port, int slot, int block); -void mcman_initcache(void); -int mcman_clearcache(int port, int slot); -McCacheEntry *mcman_getcacheentry(int port, int slot, int cluster); -void mcman_freecluster(int port, int slot, int cluster); -int mcman_getFATindex(int port, int slot, int num); -McCacheEntry *mcman_get1stcacheEntp(void); -void mcman_addcacheentry(McCacheEntry *mce); -int mcman_flushcacheentry(McCacheEntry *mce); -int mcman_readdirentryPS1(int port, int slot, int cluster, McFsEntryPS1 **pfse); -int mcman_readclusterPS1(int port, int slot, int cluster, McCacheEntry **pmce); -int mcman_replaceBackupBlock(int port, int slot, int block); -int mcman_fillbackupblock1(int port, int slot, int block, void **pagedata, void *eccdata); -int mcman_clearsuperblock(int port, int slot); -int mcman_ioerrcode(int errcode); -int mcman_modloadcb(const char *filename, int *port, int *slot); // used as callback by modload -void mcman_unit2card(u32 unit); -int mcman_initdev(void); -void mcman_deinitdev(void); +extern int mcman_getcnum (int port, int slot); +extern int mcman_correctdata(void *buf, void *ecc); +extern int mcman_sparesize(int port, int slot); +extern int mcman_setdevspec(int port, int slot); +extern int mcman_reportBadBlocks(int port, int slot); +extern int mcman_setdevinfos(int port, int slot); +extern int mcman_format2(int port, int slot); +extern int mcman_fatRseek(int fd); +extern int mcman_fatWseek(int fd); +extern int mcman_findfree2(int port, int slot, int reserve); +extern int mcman_dread2(int fd, MC_IO_DRE_T *dirent); +extern int mcman_getstat2(int port, int slot, const char *filename, MC_IO_STA_T *stat); +extern int mcman_setinfo2(int port, int slot, const char *filename, sceMcTblGetDir *info, int flags); +extern int mcman_read2(int fd, void *buffer, int nbyte); +extern int mcman_write2(int fd, void *buffer, int nbyte); +extern int mcman_close2(int fd); +extern int mcman_getentspace(int port, int slot, const char *dirname); +extern int mcman_cachedirentry(int port, int slot, const char *filename, McCacheDir *pcacheDir, McFsEntry **pfse, int unknown_flag); +extern int mcman_getdirinfo(int port, int slot, McFsEntry *pfse, const char *filename, McCacheDir *pcd, int unknown_flag); +extern int mcman_open2(int port, int slot, const char *filename, int flags); +extern int mcman_chdir(int port, int slot, const char *newdir, char *currentdir); +extern int mcman_writecluster(int port, int slot, int cluster, int flag); +extern int mcman_getdir2(int port, int slot, const char *dirname, int flags, int maxent, sceMcTblGetDir *info); +extern int mcman_delete2(int port, int slot, const char *filename, int flags); +extern int mcman_checkBackupBlocks(int port, int slot); +extern int mcman_unformat2(int port, int slot); +extern void mcman_initPS1PDAcom(void); +extern void mcman_deinitPS1PDAcom(void); +extern int mcman_probePS1Card2(int port, int slot); +extern int mcman_probePS1Card(int port, int slot); +extern int mcman_probePDACard(int port, int slot); +extern int mcman_setPS1devinfos(int port, int slot); +extern int mcman_format1(int port, int slot); +extern int mcman_open1(int port, int slot, const char *filename, int flags); +extern int mcman_read1(int fd, void *buffer, int nbyte); +extern int mcman_write1(int fd, void *buffer, int nbyte); +extern int mcman_getPS1direntry(int port, int slot, const char *filename, McFsEntryPS1 **pfse, int flag); +extern int mcman_dread1(int fd, MC_IO_DRE_T *dirent); +extern int mcman_getstat1(int port, int slot, const char *filename, MC_IO_STA_T *stat); +extern int mcman_setinfo1(int port, int slot, const char *filename, sceMcTblGetDir *info, int flags); +extern int mcman_getdir1(int port, int slot, const char *dirname, int flags, int maxent, sceMcTblGetDir *info); +extern int mcman_clearPS1direntry(int port, int slot, int cluster, int flags); +extern int mcman_delete1(int port, int slot, const char *filename, int flags); +extern int mcman_close1(int fd); +extern int mcman_findfree1(int port, int slot, int reserve); +extern int mcman_fatRseekPS1(int fd); +extern int mcman_fatWseekPS1(int fd); +extern int mcman_FNC8ca4(int port, int slot, MC_FHANDLE *fh); +extern int mcman_PS1pagetest(int port, int slot, int page); +extern int mcman_unformat1(int port, int slot); +extern int mcman_cachePS1dirs(int port, int slot); +extern int mcman_fillPS1backuparea(int port, int slot, int block); +extern void mcman_initcache(void); +extern int mcman_clearcache(int port, int slot); +extern McCacheEntry *mcman_getcacheentry(int port, int slot, int cluster); +extern void mcman_freecluster(int port, int slot, int cluster); +extern int mcman_getFATindex(int port, int slot, int num); +extern McCacheEntry *mcman_get1stcacheEntp(void); +extern void mcman_addcacheentry(McCacheEntry *mce); +extern int mcman_flushcacheentry(McCacheEntry *mce); +extern int mcman_readdirentryPS1(int port, int slot, int cluster, McFsEntryPS1 **pfse); +extern int mcman_readclusterPS1(int port, int slot, int cluster, McCacheEntry **pmce); +extern int mcman_replaceBackupBlock(int port, int slot, int block); +extern int mcman_fillbackupblock1(int port, int slot, int block, void **pagedata, void *eccdata); +extern int mcman_clearsuperblock(int port, int slot); +extern int mcman_ioerrcode(int errcode); +extern int mcman_modloadcb(const char *filename, int *port, int *slot); // used as callback by modload +extern void mcman_unit2card(u32 unit); +extern int mcman_initdev(void); +extern void mcman_deinitdev(void); #if defined(BUILDING_VMCMAN) -int mcman_iomanx_backing_mount(int port, int slot, const char *filename); -int mcman_iomanx_backing_umount(int port, int slot); -int mcman_iomanx_backing_getcardspec(int port, int slot, s16 *pagesize, u16 *blocksize, int *cardsize, u8 *flags); -int mcman_iomanx_backing_erase(int port, int slot, int page); -int mcman_iomanx_backing_write(int port, int slot, int page, void *pagebuf, void *eccbuf); -int mcman_iomanx_backing_read(int port, int slot, int page, void *pagebuf, void *eccbuf); +extern int mcman_iomanx_backing_mount(int port, int slot, const char *filename); +extern int mcman_iomanx_backing_umount(int port, int slot); +extern int mcman_iomanx_backing_getcardspec(int port, int slot, s16 *pagesize, u16 *blocksize, int *cardsize, u8 *flags); +extern int mcman_iomanx_backing_erase(int port, int slot, int page); +extern int mcman_iomanx_backing_write(int port, int slot, int page, void *pagebuf, void *eccbuf); +extern int mcman_iomanx_backing_read(int port, int slot, int page, void *pagebuf, void *eccbuf); #endif typedef struct { // size = 384 diff --git a/iop/memorycard/mcserv/src/mcserv.h b/iop/memorycard/mcserv/src/mcserv.h index d5fe1e62dc9..cfcfc99c10e 100644 --- a/iop/memorycard/mcserv/src/mcserv.h +++ b/iop/memorycard/mcserv/src/mcserv.h @@ -41,51 +41,51 @@ // internal function prototypes -void *cb_rpc_S_0400(u32 fno, void *buf, int size); -void thread_rpc_S_0400(void* param); -int sceMcInit(void); -int sceMcOpen(void); -int sceMcClose(void); -int sceMcRead(void); -int sceMcWrite(void); -int sceMcSeek(void); -int sceMcGetDir(void); -int sceMcFormat(void); -int sceMcGetInfo(void); -int sceMcDelete(void); -int sceMcFlush(void); -int sceMcChDir(void); -int sceMcSetFileInfo(void); -int sceMcEraseBlock(void); -int sceMcReadPage(void); -int sceMcWritePage(void); -int sceMcUnformat(void); -int sceMcRead2(void); -int sceMcGetInfo2(void); -int sceMcGetEntSpace(void); -int sceMcCheckBlock(void); +extern void *cb_rpc_S_0400(u32 fno, void *buf, int size); +extern void thread_rpc_S_0400(void* param); +extern int sceMcInit(void); +extern int sceMcOpen(void); +extern int sceMcClose(void); +extern int sceMcRead(void); +extern int sceMcWrite(void); +extern int sceMcSeek(void); +extern int sceMcGetDir(void); +extern int sceMcFormat(void); +extern int sceMcGetInfo(void); +extern int sceMcDelete(void); +extern int sceMcFlush(void); +extern int sceMcChDir(void); +extern int sceMcSetFileInfo(void); +extern int sceMcEraseBlock(void); +extern int sceMcReadPage(void); +extern int sceMcWritePage(void); +extern int sceMcUnformat(void); +extern int sceMcRead2(void); +extern int sceMcGetInfo2(void); +extern int sceMcGetEntSpace(void); +extern int sceMcCheckBlock(void); -int _McInit(void *rpc_buf); -int _McOpen(void *rpc_buf); -int _McClose(void *rpc_buf); -int _McRead(void *rpc_buf); -int _McWrite(void *rpc_buf); -int _McSeek(void *rpc_buf); -int _McGetDir(void *rpc_buf); -int _McFormat(void *rpc_buf); -int _McGetInfo(void *rpc_buf); -int _McDelete(void *rpc_buf); -int _McFlush(void *rpc_buf); -int _McChDir(void *rpc_buf); -int _McSetFileInfo(void *rpc_buf); -int _McEraseBlock(void *rpc_buf); -int _McReadPage(void *rpc_buf); -int _McWritePage(void *rpc_buf); -int _McUnformat(void *rpc_buf); -int _McRead2(void *rpc_buf); -int _McGetInfo2(void *rpc_buf); -int _McGetEntSpace(void *rpc_buf); -int _McCheckBlock(void *rpc_buf); +extern int _McInit(void *rpc_buf); +extern int _McOpen(void *rpc_buf); +extern int _McClose(void *rpc_buf); +extern int _McRead(void *rpc_buf); +extern int _McWrite(void *rpc_buf); +extern int _McSeek(void *rpc_buf); +extern int _McGetDir(void *rpc_buf); +extern int _McFormat(void *rpc_buf); +extern int _McGetInfo(void *rpc_buf); +extern int _McDelete(void *rpc_buf); +extern int _McFlush(void *rpc_buf); +extern int _McChDir(void *rpc_buf); +extern int _McSetFileInfo(void *rpc_buf); +extern int _McEraseBlock(void *rpc_buf); +extern int _McReadPage(void *rpc_buf); +extern int _McWritePage(void *rpc_buf); +extern int _McUnformat(void *rpc_buf); +extern int _McRead2(void *rpc_buf); +extern int _McGetInfo2(void *rpc_buf); +extern int _McGetEntSpace(void *rpc_buf); +extern int _McCheckBlock(void *rpc_buf); // filename related mc command // used by: mcOpen, mcGetDir, mcChdir, mcDelete, mcSetFileInfo, mcRename, mcGetEntSpace diff --git a/iop/network/netman/src/include/internal.h b/iop/network/netman/src/include/internal.h index 4fcb1cd963a..2cab6e70ab1 100644 --- a/iop/network/netman/src/include/internal.h +++ b/iop/network/netman/src/include/internal.h @@ -1,4 +1,4 @@ -void NetManUpdateStackNIFLinkState(void); -void NetManToggleGlobalNetIFLinkState(unsigned char state); -void *malloc(int size); -void free(void *buffer); +extern void NetManUpdateStackNIFLinkState(void); +extern void NetManToggleGlobalNetIFLinkState(unsigned char state); +extern void *malloc(int size); +extern void free(void *buffer); diff --git a/iop/network/netman/src/include/rpc_client.h b/iop/network/netman/src/include/rpc_client.h index 21768212682..7a3516c4458 100644 --- a/iop/network/netman/src/include/rpc_client.h +++ b/iop/network/netman/src/include/rpc_client.h @@ -1,6 +1,6 @@ -int NetManInitRPCClient(void); -void NetManDeinitRPCClient(void); -void NetManRpcToggleGlobalNetIFLinkState(int state); -void *NetManRpcNetProtStackAllocRxPacket(unsigned int length, void **payload); -void NetManRpcNetProtStackFreeRxPacket(void *packet); -void NetManRpcProtStackEnQRxPacket(void *packet); +extern int NetManInitRPCClient(void); +extern void NetManDeinitRPCClient(void); +extern void NetManRpcToggleGlobalNetIFLinkState(int state); +extern void *NetManRpcNetProtStackAllocRxPacket(unsigned int length, void **payload); +extern void NetManRpcNetProtStackFreeRxPacket(void *packet); +extern void NetManRpcProtStackEnQRxPacket(void *packet); diff --git a/iop/network/netman/src/include/rpc_server.h b/iop/network/netman/src/include/rpc_server.h index 820d62aa158..21572c472f3 100644 --- a/iop/network/netman/src/include/rpc_server.h +++ b/iop/network/netman/src/include/rpc_server.h @@ -1,2 +1,2 @@ -int NetmanInitRPCServer(void); -void NetmanDeinitRPCClient(void); +extern int NetmanInitRPCServer(void); +extern void NetmanDeinitRPCClient(void); diff --git a/iop/network/smap/src/include/main.h b/iop/network/smap/src/include/main.h index 97b978b1f00..284eaf50136 100644 --- a/iop/network/smap/src/include/main.h +++ b/iop/network/smap/src/include/main.h @@ -74,22 +74,22 @@ struct SmapDriverData #define SMAP_EVENT_LINK_CHECK 0x10 /* Function prototypes */ -int DisplayBanner(void); -int smap_init(int argc, char *argv[]); +extern int DisplayBanner(void); +extern int smap_init(int argc, char *argv[]); #ifdef BUILDING_SMAP_PS2IP -int SMAPInitStart(void); +extern int SMAPInitStart(void); #endif -int SMAPStart(void); -void SMAPStop(void); -void SMAPXmit(void); -int SMAPGetMACAddress(u8 *buffer); +extern int SMAPStart(void); +extern void SMAPStop(void); +extern void SMAPXmit(void); +extern int SMAPGetMACAddress(u8 *buffer); #ifdef BUILDING_SMAP_PS2IP -void PS2IPLinkStateUp(void); -void PS2IPLinkStateDown(void); +extern void PS2IPLinkStateUp(void); +extern void PS2IPLinkStateDown(void); -void SMapLowLevelInput(struct pbuf *pBuf); -int SMapTxPacketNext(void **payload); -void SMapTxPacketDeQ(void); +extern void SMapLowLevelInput(struct pbuf *pBuf); +extern int SMapTxPacketNext(void **payload); +extern void SMapTxPacketDeQ(void); #endif /* Data prototypes */ diff --git a/iop/network/smap/src/include/xfer.h b/iop/network/smap/src/include/xfer.h index f05e5e056a7..7147fcfcc32 100644 --- a/iop/network/smap/src/include/xfer.h +++ b/iop/network/smap/src/include/xfer.h @@ -4,7 +4,7 @@ #include "main.h" -int HandleRxIntr(struct SmapDriverData *SmapDrivPrivData); -int HandleTxReqs(struct SmapDriverData *SmapDrivPrivData); +extern int HandleRxIntr(struct SmapDriverData *SmapDrivPrivData); +extern int HandleTxReqs(struct SmapDriverData *SmapDrivPrivData); #endif diff --git a/iop/network/smbman/src/auth.h b/iop/network/smbman/src/auth.h index 44f5e90a1ba..845c7124d03 100644 --- a/iop/network/smbman/src/auth.h +++ b/iop/network/smbman/src/auth.h @@ -7,8 +7,8 @@ #define __AUTH_H__ // function prototypes -unsigned char *LM_Password_Hash(const unsigned char *password, unsigned char *cipher); -unsigned char *NTLM_Password_Hash(const unsigned char *password, unsigned char *cipher); -unsigned char *LM_Response(const unsigned char *LMhash, unsigned char *chal, unsigned char *cipher); +extern unsigned char *LM_Password_Hash(const unsigned char *password, unsigned char *cipher); +extern unsigned char *NTLM_Password_Hash(const unsigned char *password, unsigned char *cipher); +extern unsigned char *LM_Response(const unsigned char *LMhash, unsigned char *chal, unsigned char *cipher); #endif diff --git a/iop/network/smbman/src/des.h b/iop/network/smbman/src/des.h index 6682b4c2894..a4ac2659ba3 100644 --- a/iop/network/smbman/src/des.h +++ b/iop/network/smbman/src/des.h @@ -2,6 +2,6 @@ #define __DES_H__ // function prototypes -unsigned char *DES(const unsigned char *key, const unsigned char *message, unsigned char *cipher); +extern unsigned char *DES(const unsigned char *key, const unsigned char *message, unsigned char *cipher); #endif diff --git a/iop/network/smbman/src/md4.h b/iop/network/smbman/src/md4.h index 682c4ee085b..831a8804087 100644 --- a/iop/network/smbman/src/md4.h +++ b/iop/network/smbman/src/md4.h @@ -2,6 +2,6 @@ #define __MD4_H__ // function prototypes -unsigned char *MD4(unsigned char *message, int len, unsigned char *cipher); +extern unsigned char *MD4(unsigned char *message, int len, unsigned char *cipher); #endif diff --git a/iop/network/smbman/src/poll.h b/iop/network/smbman/src/poll.h index 925bc9e00e3..9ce7b54f289 100644 --- a/iop/network/smbman/src/poll.h +++ b/iop/network/smbman/src/poll.h @@ -20,6 +20,6 @@ typedef struct pollfd #define POLLHUP 0x0010 #define POLLNVAL 0x0020 -int poll(struct pollfd *fds, unsigned long nfds, int timeout); +extern int poll(struct pollfd *fds, unsigned long nfds, int timeout); #endif diff --git a/iop/network/smbman/src/smb.h b/iop/network/smbman/src/smb.h index e947c34dc18..c6309e620a7 100644 --- a/iop/network/smbman/src/smb.h +++ b/iop/network/smbman/src/smb.h @@ -861,31 +861,31 @@ typedef struct } __attribute__((packed)) RenameResponse_t; // function prototypes -server_specs_t *getServerSpecs(void); - -int smb_Connect(char *SMBServerIP, int SMBServerPort); -int smb_Disconnect(void); - -int smb_NegotiateProtocol(u32 *capabilities); -int smb_SessionSetupAndX(char *User, char *Password, int PasswordType, u32 capabilities); -int smb_TreeConnectAndX(int UID, char *ShareName, char *Password, int PasswordType); -int smb_TreeDisconnect(int UID, int TID); -int smb_NetShareEnum(int UID, int TID, ShareEntry_t *shareEntries, int index, int maxEntries); -int smb_QueryInformationDisk(int UID, int TID, smbQueryDiskInfo_out_t *QueryInformationDisk); -int smb_QueryPathInformation(int UID, int TID, PathInformation_t *Info, char *Path); -int smb_FindFirstNext2(int UID, int TID, char *Path, int cmd, SearchInfo_t *info); -int smb_LogOffAndX(int UID); -int smb_Echo(void *echo, int len); - -int smb_OpenAndX(int UID, int TID, char *filename, s64 *filesize, int mode); -int smb_ReadAndX(int UID, int TID, int FID, s64 offset, void *readbuf, int nbytes); -int smb_WriteAndX(int UID, int TID, int FID, s64 offset, void *writebuf, int nbytes); -int smb_ReadFile(int UID, int TID, int FID, s64 fileoffset, void *readbuf, int nbytes); -int smb_WriteFile(int UID, int TID, int FID, s64 fileoffset, void *writebuf, int nbytes); -int smb_Close(int UID, int TID, int FID); -int smb_Delete(int UID, int TID, char *Path); -int smb_ManageDirectory(int UID, int TID, char *Path, int cmd); -int smb_Rename(int UID, int TID, char *oldPath, char *newPath); +extern server_specs_t *getServerSpecs(void); + +extern int smb_Connect(char *SMBServerIP, int SMBServerPort); +extern int smb_Disconnect(void); + +extern int smb_NegotiateProtocol(u32 *capabilities); +extern int smb_SessionSetupAndX(char *User, char *Password, int PasswordType, u32 capabilities); +extern int smb_TreeConnectAndX(int UID, char *ShareName, char *Password, int PasswordType); +extern int smb_TreeDisconnect(int UID, int TID); +extern int smb_NetShareEnum(int UID, int TID, ShareEntry_t *shareEntries, int index, int maxEntries); +extern int smb_QueryInformationDisk(int UID, int TID, smbQueryDiskInfo_out_t *QueryInformationDisk); +extern int smb_QueryPathInformation(int UID, int TID, PathInformation_t *Info, char *Path); +extern int smb_FindFirstNext2(int UID, int TID, char *Path, int cmd, SearchInfo_t *info); +extern int smb_LogOffAndX(int UID); +extern int smb_Echo(void *echo, int len); + +extern int smb_OpenAndX(int UID, int TID, char *filename, s64 *filesize, int mode); +extern int smb_ReadAndX(int UID, int TID, int FID, s64 offset, void *readbuf, int nbytes); +extern int smb_WriteAndX(int UID, int TID, int FID, s64 offset, void *writebuf, int nbytes); +extern int smb_ReadFile(int UID, int TID, int FID, s64 fileoffset, void *readbuf, int nbytes); +extern int smb_WriteFile(int UID, int TID, int FID, s64 fileoffset, void *writebuf, int nbytes); +extern int smb_Close(int UID, int TID, int FID); +extern int smb_Delete(int UID, int TID, char *Path); +extern int smb_ManageDirectory(int UID, int TID, char *Path, int cmd); +extern int smb_Rename(int UID, int TID, char *oldPath, char *newPath); #define MAX_SMB_BUF 4096 // must fit on u16 !!! #define MAX_SMB_BUF_HDR 128 // Must be at least as large as the largest header structure. diff --git a/iop/network/smbman/src/smb_fio.h b/iop/network/smbman/src/smb_fio.h index 821f473be76..38e3022bcf2 100644 --- a/iop/network/smbman/src/smb_fio.h +++ b/iop/network/smbman/src/smb_fio.h @@ -7,24 +7,24 @@ #define __SMB_FIO_H__ // smb driver ops functions prototypes -int smb_initdev(void); -int smb_init(iop_device_t *iop_dev); -int smb_deinit(iop_device_t *dev); -int smb_open(iop_file_t *f, const char *filename, int flags, int mode); -int smb_close(iop_file_t *f); -int smb_lseek(iop_file_t *f, int pos, int where); -int smb_read(iop_file_t *f, void *buf, int size); -int smb_write(iop_file_t *f, void *buf, int size); -int smb_remove(iop_file_t *f, const char *filename); -int smb_mkdir(iop_file_t *f, const char *dirname, int mode); -int smb_rmdir(iop_file_t *f, const char *dirname); -int smb_dopen(iop_file_t *f, const char *dirname); -int smb_dclose(iop_file_t *f); -int smb_dread(iop_file_t *f, iox_dirent_t *dirent); -int smb_getstat(iop_file_t *f, const char *filename, iox_stat_t *stat); -int smb_rename(iop_file_t *f, const char *oldname, const char *newname); -int smb_chdir(iop_file_t *f, const char *dirname); -s64 smb_lseek64(iop_file_t *f, s64 pos, int where); -int smb_devctl(iop_file_t *f, const char *devname, int cmd, void *arg, unsigned int arglen, void *bufp, unsigned int buflen); +extern int smb_initdev(void); +extern int smb_init(iop_device_t *iop_dev); +extern int smb_deinit(iop_device_t *dev); +extern int smb_open(iop_file_t *f, const char *filename, int flags, int mode); +extern int smb_close(iop_file_t *f); +extern int smb_lseek(iop_file_t *f, int pos, int where); +extern int smb_read(iop_file_t *f, void *buf, int size); +extern int smb_write(iop_file_t *f, void *buf, int size); +extern int smb_remove(iop_file_t *f, const char *filename); +extern int smb_mkdir(iop_file_t *f, const char *dirname, int mode); +extern int smb_rmdir(iop_file_t *f, const char *dirname); +extern int smb_dopen(iop_file_t *f, const char *dirname); +extern int smb_dclose(iop_file_t *f); +extern int smb_dread(iop_file_t *f, iox_dirent_t *dirent); +extern int smb_getstat(iop_file_t *f, const char *filename, iox_stat_t *stat); +extern int smb_rename(iop_file_t *f, const char *oldname, const char *newname); +extern int smb_chdir(iop_file_t *f, const char *dirname); +extern s64 smb_lseek64(iop_file_t *f, s64 pos, int where); +extern int smb_devctl(iop_file_t *f, const char *devname, int cmd, void *arg, unsigned int arglen, void *bufp, unsigned int buflen); #endif diff --git a/iop/security/secrman/src/CardAuth.h b/iop/security/secrman/src/CardAuth.h index e0bc8554cc5..f16c9c9c0dd 100644 --- a/iop/security/secrman/src/CardAuth.h +++ b/iop/security/secrman/src/CardAuth.h @@ -1,15 +1,15 @@ -void ResetMcHandlers(void); -void SetMcCommandHandler(McCommandHandler_t handler); -McCommandHandler_t GetMcCommandHandler(void); -void SetMcDevIDHandler(McDevIDHandler_t handler); -McDevIDHandler_t GetMcDevIDHandler(void); // unused. -int McDeviceIDToCNum(int port, int slot); -int SendMcCommand(int port, int slot, sio2_transfer_data_t *sio2packet); -int card_auth(int port, int slot, int arg3, int command); -unsigned char calculate_sio2_buffer_checksum(const void *buffer, unsigned int length); -int card_auth_write(int port, int slot, const void *buffer, int arg3, int command); -int card_auth_read(int port, int slot, void *buffer, int arg3, int command); +extern void ResetMcHandlers(void); +extern void SetMcCommandHandler(McCommandHandler_t handler); +extern McCommandHandler_t GetMcCommandHandler(void); +extern void SetMcDevIDHandler(McDevIDHandler_t handler); +extern McDevIDHandler_t GetMcDevIDHandler(void); // unused. +extern int McDeviceIDToCNum(int port, int slot); +extern int SendMcCommand(int port, int slot, sio2_transfer_data_t *sio2packet); +extern int card_auth(int port, int slot, int arg3, int command); +extern unsigned char calculate_sio2_buffer_checksum(const void *buffer, unsigned int length); +extern int card_auth_write(int port, int slot, const void *buffer, int arg3, int command); +extern int card_auth_read(int port, int slot, void *buffer, int arg3, int command); -int card_auth_60(int port, int slot); -int card_auth_key_change(int port, int slot, int command); -int card_auth2(int port, int slot, int arg3, int command); +extern int card_auth_60(int port, int slot); +extern int card_auth_key_change(int port, int slot, int command); +extern int card_auth2(int port, int slot, int arg3, int command); diff --git a/iop/security/secrman/src/MechaAuth.h b/iop/security/secrman/src/MechaAuth.h index a956100467a..1d60929bbce 100644 --- a/iop/security/secrman/src/MechaAuth.h +++ b/iop/security/secrman/src/MechaAuth.h @@ -1,24 +1,24 @@ -int SendMechaCommand(int command, const void *input, unsigned short int length, void *output); +extern int SendMechaCommand(int command, const void *input, unsigned short int length, void *output); -int mechacon_auth_80(int cnum); -int mechacon_auth_81(int cnum); -int mechacon_auth_82(const void *buffer, const void *buffer2); -int mechacon_auth_83(const void *buffer); -int mechacon_auth_84(void *buffer, void *buffer2); -int mechacon_auth_85(void *buffer, void *buffer2); -int mechacon_auth_86(void *buffer, void *buffer2); -int mechacon_auth_87(void *buffer); -int mechacon_auth_88(void); +extern int mechacon_auth_80(int cnum); +extern int mechacon_auth_81(int cnum); +extern int mechacon_auth_82(const void *buffer, const void *buffer2); +extern int mechacon_auth_83(const void *buffer); +extern int mechacon_auth_84(void *buffer, void *buffer2); +extern int mechacon_auth_85(void *buffer, void *buffer2); +extern int mechacon_auth_86(void *buffer, void *buffer2); +extern int mechacon_auth_87(void *buffer); +extern int mechacon_auth_88(void); -int write_HD_start(unsigned char mode, int cnum, int arg2, unsigned short int HeaderLength); -int write_data(const void *buffer, unsigned short int length); -int pol_cal_cmplt(void); -int func_00001c98(unsigned short int size); -int get_BIT_length(unsigned short int *BitLength); -int func_00001b00(void *data, unsigned short int length); -int mechacon_set_block_size(unsigned short int size); -int _PreEncryptKbit1(void *kbit1); // request first half of pre-encrypted kbit -int _PreEncryptKbit2(void *kbit2); // request second half of pre-encrypted kbit -int _PreEncryptKc1(void *kc1); // request first half of pre-encrypted kc -int _PreEncryptKc2(void *kc2); // request second half of pre-encrypted kc -int func_00001ed8(void *icvps2); +extern int write_HD_start(unsigned char mode, int cnum, int arg2, unsigned short int HeaderLength); +extern int write_data(const void *buffer, unsigned short int length); +extern int pol_cal_cmplt(void); +extern int func_00001c98(unsigned short int size); +extern int get_BIT_length(unsigned short int *BitLength); +extern int func_00001b00(void *data, unsigned short int length); +extern int mechacon_set_block_size(unsigned short int size); +extern int _PreEncryptKbit1(void *kbit1); // request first half of pre-encrypted kbit +extern int _PreEncryptKbit2(void *kbit2); // request second half of pre-encrypted kbit +extern int _PreEncryptKc1(void *kc1); // request first half of pre-encrypted kc +extern int _PreEncryptKc2(void *kc2); // request second half of pre-encrypted kc +extern int func_00001ed8(void *icvps2); diff --git a/iop/security/secrman/src/keyman.h b/iop/security/secrman/src/keyman.h index cfcbb809905..4c40bb21f1e 100644 --- a/iop/security/secrman/src/keyman.h +++ b/iop/security/secrman/src/keyman.h @@ -1,6 +1,6 @@ -void store_kbit(void *buffer, const void *kbit); -void store_kc(void *buffer, const void *kc); -void get_Kbit(const void *buffer, void *Kbit); -void get_Kc(const void *buffer, void *Kc); -void get_icvps2(const void *buffer, void *icvps2); -void store_icvps2(void *buffer, const void *icvps2); +extern void store_kbit(void *buffer, const void *kbit); +extern void store_kc(void *buffer, const void *kc); +extern void get_Kbit(const void *buffer, void *Kbit); +extern void get_Kc(const void *buffer, void *Kc); +extern void get_icvps2(const void *buffer, void *icvps2); +extern void store_icvps2(void *buffer, const void *icvps2); diff --git a/iop/sio/mx4sio_bd/src/crc16.h b/iop/sio/mx4sio_bd/src/crc16.h index ed600619fa5..12452e25d08 100644 --- a/iop/sio/mx4sio_bd/src/crc16.h +++ b/iop/sio/mx4sio_bd/src/crc16.h @@ -3,6 +3,6 @@ #include "stdint.h" -uint16_t crc16(void *buf, int len); +extern uint16_t crc16(void *buf, int len); #endif diff --git a/iop/sio/mx4sio_bd/src/ioplib.h b/iop/sio/mx4sio_bd/src/ioplib.h index 7ff39a4940d..d8a050cf20f 100644 --- a/iop/sio/mx4sio_bd/src/ioplib.h +++ b/iop/sio/mx4sio_bd/src/ioplib.h @@ -5,10 +5,10 @@ #include -iop_library_t *ioplib_getByName(const char *name); -unsigned int ioplib_getTableSize(iop_library_t *lib); -void *ioplib_hookExportEntry(iop_library_t *lib, unsigned int entry, void *func); -void ioplib_relinkExports(iop_library_t *lib); +extern iop_library_t *ioplib_getByName(const char *name); +extern unsigned int ioplib_getTableSize(iop_library_t *lib); +extern void *ioplib_hookExportEntry(iop_library_t *lib, unsigned int entry, void *func); +extern void ioplib_relinkExports(iop_library_t *lib); #endif diff --git a/iop/sio/mx4sio_bd/src/mx4sio.h b/iop/sio/mx4sio_bd/src/mx4sio.h index 8833f48a60e..259c34ff518 100644 --- a/iop/sio/mx4sio_bd/src/mx4sio.h +++ b/iop/sio/mx4sio_bd/src/mx4sio.h @@ -55,24 +55,24 @@ extern int sio2_event_flag; extern const uint8_t reverse_byte_LUT8[256]; /* MX SIO2 functions */ -void mx_sio2_lock(uint8_t intr_type); -void mx_sio2_unlock(uint8_t intr_type); -void mx_sio2_set_baud(uint8_t baud); +extern void mx_sio2_lock(uint8_t intr_type); +extern void mx_sio2_unlock(uint8_t intr_type); +extern void mx_sio2_set_baud(uint8_t baud); -uint8_t mx_sio2_write_byte(uint8_t byte); -uint8_t mx_sio2_write_dummy(void); +extern uint8_t mx_sio2_write_byte(uint8_t byte); +extern uint8_t mx_sio2_write_dummy(void); -void mx_sio2_rx_pio(uint8_t *buffer, uint32_t size); /* PIO only used for sending commands */ -void mx_sio2_tx_pio(uint8_t *buffer, uint32_t size); +extern void mx_sio2_rx_pio(uint8_t *buffer, uint32_t size); /* PIO only used for sending commands */ +extern void mx_sio2_tx_pio(uint8_t *buffer, uint32_t size); -void mx_sio2_start_rx_dma(uint8_t *buffer); /* DMA used for all other transfers */ -void mx_sio2_start_tx_dma(uint8_t *buffer); +extern void mx_sio2_start_rx_dma(uint8_t *buffer); /* DMA used for all other transfers */ +extern void mx_sio2_start_tx_dma(uint8_t *buffer); -uint8_t mx_sio2_wait_equal(uint8_t value, uint32_t count); -uint8_t mx_sio2_wait_not_equal(uint8_t value, uint32_t count); -uint8_t mx_sio2_wait_equal_masked(uint8_t value, uint8_t mask, uint32_t count); +extern uint8_t mx_sio2_wait_equal(uint8_t value, uint32_t count); +extern uint8_t mx_sio2_wait_not_equal(uint8_t value, uint32_t count); +extern uint8_t mx_sio2_wait_equal_masked(uint8_t value, uint8_t mask, uint32_t count); /* misc */ -void reverse_buffer(uint32_t *buffer, uint32_t count); +extern void reverse_buffer(uint32_t *buffer, uint32_t count); #endif diff --git a/iop/sio/mx4sio_bd/src/sio2man_hook.h b/iop/sio/mx4sio_bd/src/sio2man_hook.h index 87ca46a5796..8cb7c77042a 100644 --- a/iop/sio/mx4sio_bd/src/sio2man_hook.h +++ b/iop/sio/mx4sio_bd/src/sio2man_hook.h @@ -2,14 +2,14 @@ #define SIO2MAN_HOOK_H -int sio2man_hook_init(); -void sio2man_hook_deinit(); +extern int sio2man_hook_init(); +extern void sio2man_hook_deinit(); // Lock all communication to SIO2MAN // this is needed for drivers that communicate directly to sio2, like mx4sio. // Do NOT lock for long duration, only for single (high speed) transfers -void sio2man_hook_sio2_lock(); -void sio2man_hook_sio2_unlock(); +extern void sio2man_hook_sio2_lock(); +extern void sio2man_hook_sio2_unlock(); #endif diff --git a/iop/sio/mx4sio_bd/src/spi_sdcard_crc7.h b/iop/sio/mx4sio_bd/src/spi_sdcard_crc7.h index c6ff4255c97..2867f379972 100644 --- a/iop/sio/mx4sio_bd/src/spi_sdcard_crc7.h +++ b/iop/sio/mx4sio_bd/src/spi_sdcard_crc7.h @@ -8,9 +8,9 @@ // Set #if SD_CRC7_MODE == CRC7_MODE_RAM_TABLE -void crc7_generate_table(void); +extern void crc7_generate_table(void); #endif -uint8_t crc7(const uint8_t message[], size_t length); +extern uint8_t crc7(const uint8_t message[], size_t length); #endif //__SPI_SDCARD_CRC7_H__ diff --git a/iop/sio/mx4sio_bd/src/spi_sdcard_driver.h b/iop/sio/mx4sio_bd/src/spi_sdcard_driver.h index 94a03bb465c..786da38075a 100644 --- a/iop/sio/mx4sio_bd/src/spi_sdcard_driver.h +++ b/iop/sio/mx4sio_bd/src/spi_sdcard_driver.h @@ -160,18 +160,18 @@ typedef struct spisd_t extern spisd_t sdcard; extern struct block_device bd; -uint16_t spisd_read_status_register(); +extern uint16_t spisd_read_status_register(); /* init */ -int spisd_init_card(); /* bring card up from identification mode to data-transfer mode */ -int spisd_get_card_info(); /* get card info and reattach to bdm if card capacity changed */ -int spisd_recover(); +extern int spisd_init_card(); /* bring card up from identification mode to data-transfer mode */ +extern int spisd_get_card_info(); /* get card info and reattach to bdm if card capacity changed */ +extern int spisd_recover(); /* BDM functions */ -int spisd_read(struct block_device *bd, uint64_t sector, void *buffer, uint16_t count); -int spisd_write(struct block_device *bd, uint64_t sector, const void *buffer, uint16_t count); -void spisd_flush(struct block_device *bd); -int spisd_stop(struct block_device *bd); +extern int spisd_read(struct block_device *bd, uint64_t sector, void *buffer, uint16_t count); +extern int spisd_write(struct block_device *bd, uint64_t sector, const void *buffer, uint16_t count); +extern void spisd_flush(struct block_device *bd); +extern int spisd_stop(struct block_device *bd); #endif \ No newline at end of file diff --git a/iop/sound/ahx/include/ahx.h b/iop/sound/ahx/include/ahx.h index 47079896692..d6c1c2cc494 100644 --- a/iop/sound/ahx/include/ahx.h +++ b/iop/sound/ahx/include/ahx.h @@ -109,23 +109,23 @@ struct AHXWaves char HighPasses[0x31588]; }; -void AHXPlayer_Init(); -int AHXPlayer_LoadSongBuffer(void *Buffer, int Len); +extern void AHXPlayer_Init(); +extern int AHXPlayer_LoadSongBuffer(void *Buffer, int Len); #ifdef WIN32 -int AHXPlayer_LoadSong(char *Filename); +extern int AHXPlayer_LoadSong(char *Filename); #endif -int AHXPlayer_InitSubsong(int Nr); -void AHXPlayer_NextPosition(); -void AHXPlayer_PrevPosition(); -void AHXPlayer_VoiceOnOff(int Voice, int OnOff); -void AHXPlayer_SetAudio(int v); -void AHXPlayer_PListCommandParse(int v, int FX, int FXParam); -void AHXPlayer_PlayIRQ(); -void AHXPlayer_ProcessStep(int v); -void AHXPlayer_ProcessFrame(int v); -void AHXPlayer_SetBoost(int boostval); -void AHXPlayer_SetOversampling(int enable); +extern int AHXPlayer_InitSubsong(int Nr); +extern void AHXPlayer_NextPosition(); +extern void AHXPlayer_PrevPosition(); +extern void AHXPlayer_VoiceOnOff(int Voice, int OnOff); +extern void AHXPlayer_SetAudio(int v); +extern void AHXPlayer_PListCommandParse(int v, int FX, int FXParam); +extern void AHXPlayer_PlayIRQ(); +extern void AHXPlayer_ProcessStep(int v); +extern void AHXPlayer_ProcessFrame(int v); +extern void AHXPlayer_SetBoost(int boostval); +extern void AHXPlayer_SetOversampling(int enable); -void AHXOutput_MixBuffer(short *target); +extern void AHXOutput_MixBuffer(short *target); #endif /* __AHX_H__ */ diff --git a/iop/sound/audsrv/include/audsrv.h b/iop/sound/audsrv/include/audsrv.h index 52022b0d308..1e8ec26d3ea 100644 --- a/iop/sound/audsrv/include/audsrv.h +++ b/iop/sound/audsrv/include/audsrv.h @@ -67,41 +67,41 @@ #define AUDSRV_ERR_NO_DISC 0x0006 #define AUDSRV_ERR_NO_MORE_CHANNELS 0x0007 -int audsrv_init(); -int audsrv_quit(); +extern int audsrv_init(); +extern int audsrv_quit(); /* audio streaming functions */ -int audsrv_format_ok(int freq, int bits, int channels); -int audsrv_set_format(int freq, int bits, int channels); -int audsrv_wait_audio(int buflen); -int audsrv_play_audio(const char *buf, int buflen); -int audsrv_stop_audio(); -int audsrv_set_volume(int vol); -int audsrv_available(); -int audsrv_queued(); +extern int audsrv_format_ok(int freq, int bits, int channels); +extern int audsrv_set_format(int freq, int bits, int channels); +extern int audsrv_wait_audio(int buflen); +extern int audsrv_play_audio(const char *buf, int buflen); +extern int audsrv_stop_audio(); +extern int audsrv_set_volume(int vol); +extern int audsrv_available(); +extern int audsrv_queued(); /* cdda playing functions */ -int audsrv_play_cd(int track); -int audsrv_stop_cd(); -int audsrv_set_threshold(int amount); -int audsrv_get_cdpos(); -int audsrv_get_trackpos(); -int audsrv_get_numtracks(); -int audsrv_get_track_offset(int track); -int audsrv_cd_pause(); -int audsrv_cd_resume(); -int audsrv_cd_play_sectors(int start, int end); -int audsrv_get_cd_status(); -int audsrv_get_cd_type(); +extern int audsrv_play_cd(int track); +extern int audsrv_stop_cd(); +extern int audsrv_set_threshold(int amount); +extern int audsrv_get_cdpos(); +extern int audsrv_get_trackpos(); +extern int audsrv_get_numtracks(); +extern int audsrv_get_track_offset(int track); +extern int audsrv_cd_pause(); +extern int audsrv_cd_resume(); +extern int audsrv_cd_play_sectors(int start, int end); +extern int audsrv_get_cd_status(); +extern int audsrv_get_cd_type(); /* adpcm functions */ -int audsrv_adpcm_init(); -int audsrv_adpcm_set_volume(int ch, int voll, int volr); -void *audsrv_load_adpcm(u32 *buffer, int size, int id); +extern int audsrv_adpcm_init(); +extern int audsrv_adpcm_set_volume(int ch, int voll, int volr); +extern void *audsrv_load_adpcm(u32 *buffer, int size, int id); #define audsrv_play_adpcm(id) audsrv_ch_play_adpcm(-1, id) //For backward-compatibility -int audsrv_ch_play_adpcm(int ch, u32 id); -int audsrv_is_adpcm_playing(int ch, u32 id); -int free_sample(u32 id); +extern int audsrv_ch_play_adpcm(int ch, u32 id); +extern int audsrv_is_adpcm_playing(int ch, u32 id); +extern int free_sample(u32 id); #define audsrv_IMPORTS_start DECLARE_IMPORT_TABLE(audsrv, 1, 4) #define audsrv_IMPORTS_end END_IMPORT_TABLE diff --git a/iop/sound/audsrv/src/common.h b/iop/sound/audsrv/src/common.h index f57d62d29c1..4677f60c61a 100755 --- a/iop/sound/audsrv/src/common.h +++ b/iop/sound/audsrv/src/common.h @@ -24,12 +24,12 @@ * Creates a thread based on the given parameter. Upon completion, * thread is started. */ -int create_thread(void *func, int priority, void *param); +extern int create_thread(void *func, int priority, void *param); /** Helper to print buffer in hex. Useful for debugging. * @param ptr pointer to buffer * @param len buffer length */ -void print_hex_buffer(unsigned char *ptr, int len); +extern void print_hex_buffer(unsigned char *ptr, int len); #endif diff --git a/iop/sound/audsrv/src/hw.h b/iop/sound/audsrv/src/hw.h index 77980f2f6e3..1577594b279 100755 --- a/iop/sound/audsrv/src/hw.h +++ b/iop/sound/audsrv/src/hw.h @@ -15,6 +15,6 @@ #ifndef __WMEMCPY_INCLUDED__ #define __WMEMCPY_INCLUDED__ -void wmemcpy(void *dest, const void *src, int numwords); +extern void wmemcpy(void *dest, const void *src, int numwords); #endif diff --git a/iop/sound/audsrv/src/rpc_client.h b/iop/sound/audsrv/src/rpc_client.h index e447f455f13..e1e33e30fa6 100755 --- a/iop/sound/audsrv/src/rpc_client.h +++ b/iop/sound/audsrv/src/rpc_client.h @@ -15,8 +15,8 @@ #ifndef __RPC_CLIENT_H__ #define __RPC_CLIENT_H__ -void initialize_rpc_client(void); -void deinitialize_rpc_client(void); -void call_client_callback(int id); +extern void initialize_rpc_client(void); +extern void deinitialize_rpc_client(void); +extern void call_client_callback(int id); #endif diff --git a/iop/sound/audsrv/src/rpc_server.h b/iop/sound/audsrv/src/rpc_server.h index e4ad322449d..508e5f91f40 100755 --- a/iop/sound/audsrv/src/rpc_server.h +++ b/iop/sound/audsrv/src/rpc_server.h @@ -15,6 +15,6 @@ #ifndef __RPC_SERVER_H__ #define __RPC_SERVER_H__ -int initialize_rpc_thread(); +extern int initialize_rpc_thread(); #endif diff --git a/iop/sound/audsrv/src/upsamplers.h b/iop/sound/audsrv/src/upsamplers.h index 845b33e9dee..99e25d0cc6e 100755 --- a/iop/sound/audsrv/src/upsamplers.h +++ b/iop/sound/audsrv/src/upsamplers.h @@ -24,6 +24,6 @@ typedef struct upsample_t typedef int (*upsampler_t)(struct upsample_t *); -upsampler_t find_upsampler(int freq, int bits, int channels); +extern upsampler_t find_upsampler(int freq, int bits, int channels); #endif diff --git a/iop/system/alloc/include/alloc.h b/iop/system/alloc/include/alloc.h index a750a464fe8..aec9b99d6af 100644 --- a/iop/system/alloc/include/alloc.h +++ b/iop/system/alloc/include/alloc.h @@ -19,15 +19,15 @@ #include #include -void * malloc(size_t size); -void * realloc(void * ptr, size_t size); -void free(void * ptr); -void * calloc(size_t n, size_t size); -void * memalign(size_t align, size_t size); -void * __mem_walk_begin(); -void __mem_walk_read(void * token, u32 * size, void ** ptr, int * valid); -void * __mem_walk_inc(void * token); -int __mem_walk_end(void * token); +extern void * malloc(size_t size); +extern void * realloc(void * ptr, size_t size); +extern void free(void * ptr); +extern void * calloc(size_t n, size_t size); +extern void * memalign(size_t align, size_t size); +extern void * __mem_walk_begin(); +extern void __mem_walk_read(void * token, u32 * size, void ** ptr, int * valid); +extern void * __mem_walk_inc(void * token); +extern int __mem_walk_end(void * token); #define alloc_IMPORTS_start DECLARE_IMPORT_TABLE(alloc, 1, 1) #define alloc_IMPORTS_end END_IMPORT_TABLE diff --git a/iop/system/iopmgr/include/iopmgr.h b/iop/system/iopmgr/include/iopmgr.h index bdebaba7100..9d8073e4137 100644 --- a/iop/system/iopmgr/include/iopmgr.h +++ b/iop/system/iopmgr/include/iopmgr.h @@ -27,24 +27,24 @@ typedef ModuleInfo_t smod_mod_info_t __attribute__ ((deprecated)); //For backward-compatibility with older projects. /* from smod.c */ -ModuleInfo_t *smod_get_next_mod(ModuleInfo_t *cur_mod); -ModuleInfo_t *smod_get_mod_by_name(const char *name); -int smod_get_modcount_by_name(const char *name); -int smod_get_modversion_by_name(const char *name); -int smod_unload_module(const char *name); +extern ModuleInfo_t *smod_get_next_mod(ModuleInfo_t *cur_mod); +extern ModuleInfo_t *smod_get_mod_by_name(const char *name); +extern int smod_get_modcount_by_name(const char *name); +extern int smod_get_modversion_by_name(const char *name); +extern int smod_unload_module(const char *name); /* from slib.c */ -iop_library_t *slib_get_lib_by_name(const char *name); -void *slib_get_exportlist_by_name(const char *name); -int slib_get_version_by_name(const char *name); -int slib_release_library(const char *name); +extern iop_library_t *slib_get_lib_by_name(const char *name); +extern void *slib_get_exportlist_by_name(const char *name); +extern int slib_get_version_by_name(const char *name); +extern int slib_release_library(const char *name); /* from devices.c */ -iop_device_t *iopmgr_get_iomandev(char *device); -iop_device_t *iopmgr_get_iomanxdev(char *device); -iop_device_t *iopmgr_get_device(char *device); -int iopmgr_get_devicetype(char *device); -int iopmgr_get_devicelist(int man,int devtype,char *buffer); +extern iop_device_t *iopmgr_get_iomandev(char *device); +extern iop_device_t *iopmgr_get_iomanxdev(char *device); +extern iop_device_t *iopmgr_get_device(char *device); +extern int iopmgr_get_devicetype(char *device); +extern int iopmgr_get_devicelist(int man,int devtype,char *buffer); /* from modules.c */ diff --git a/iop/system/mtapman/src/freemtap.h b/iop/system/mtapman/src/freemtap.h index 84c0785a772..4c678dad64a 100644 --- a/iop/system/mtapman/src/freemtap.h +++ b/iop/system/mtapman/src/freemtap.h @@ -16,14 +16,14 @@ #define M_PRINTF(format, args...) printf(MODNAME ": " format, ## args) // rpcservers.c -s32 InitRpcServers(); +extern s32 InitRpcServers(); // freemtap.c -s32 mtapPortOpen(u32 port); -s32 mtapPortClose(u32 port); -s32 mtapGetConnection(u32 port); -s32 mtapGetSlotNumber(u32 port); -s32 mtapChangeSlot(u32 port, u32 slot); +extern s32 mtapPortOpen(u32 port); +extern s32 mtapPortClose(u32 port); +extern s32 mtapGetConnection(u32 port); +extern s32 mtapGetSlotNumber(u32 port); +extern s32 mtapChangeSlot(u32 port, u32 slot); #endif diff --git a/iop/system/padman/src/freepad.h b/iop/system/padman/src/freepad.h index 4c58dfd8c2f..e3dff165813 100644 --- a/iop/system/padman/src/freepad.h +++ b/iop/system/padman/src/freepad.h @@ -222,26 +222,26 @@ typedef struct } padState_t; // Internal functions -void WaitClearEvent(int eventflag, u32 bits, int mode, u32 *resbits_out); -int VblankStart(void *arg); -int VblankEnd(void *arg); +extern void WaitClearEvent(int eventflag, u32 bits, int mode, u32 *resbits_out); +extern int VblankStart(void *arg); +extern int VblankEnd(void *arg); // Exported/RPC functions -s32 padInit(void * ee_addr); -s32 padEnd(void); -s32 padPortClose(s32 port, s32 slot, s32 wait); -s32 padPortOpen(s32 port, s32 slot, s32 pad_area_ee_addr, u32 *buf); -u32 padSetMainMode(u32 port, u32 slot, u32 mode, u32 lock); -u32 padSetActDirect(u32 port, u32 slot, u8 *actData); -u32 padSetActAlign(u32 port, u32 slot, const u8 *actData); -u32 padGetButtonMask(u32 port, u32 slot); -u32 padSetButtonInfo(u32 port, u32 slot, u32 info); -u32 padSetVrefParam(u32 port, u32 slot, const u8 *vparam); -s32 padInfoAct(u32 port, u32 slot, s32 act, u32 val); -s32 padInfoComb(u32 port, u32 slot, s32 listno, u32 offs); -s32 padInfoMode(u32 port, u32 slot, s32 term, u32 offs); -u32 padGetPortMax(void); -u32 padGetSlotMax(u32 port); -u32 padGetModVersion(void); +extern s32 padInit(void * ee_addr); +extern s32 padEnd(void); +extern s32 padPortClose(s32 port, s32 slot, s32 wait); +extern s32 padPortOpen(s32 port, s32 slot, s32 pad_area_ee_addr, u32 *buf); +extern u32 padSetMainMode(u32 port, u32 slot, u32 mode, u32 lock); +extern u32 padSetActDirect(u32 port, u32 slot, u8 *actData); +extern u32 padSetActAlign(u32 port, u32 slot, const u8 *actData); +extern u32 padGetButtonMask(u32 port, u32 slot); +extern u32 padSetButtonInfo(u32 port, u32 slot, u32 info); +extern u32 padSetVrefParam(u32 port, u32 slot, const u8 *vparam); +extern s32 padInfoAct(u32 port, u32 slot, s32 act, u32 val); +extern s32 padInfoComb(u32 port, u32 slot, s32 listno, u32 offs); +extern s32 padInfoMode(u32 port, u32 slot, s32 term, u32 offs); +extern u32 padGetPortMax(void); +extern u32 padGetSlotMax(u32 port); +extern u32 padGetModVersion(void); #endif diff --git a/iop/system/padman/src/padCmds.h b/iop/system/padman/src/padCmds.h index 2c9d84196e6..8f70c54e4f5 100644 --- a/iop/system/padman/src/padCmds.h +++ b/iop/system/padman/src/padCmds.h @@ -12,19 +12,19 @@ #ifndef __FREEPAD_PADCMDS_H__ #define __FREEPAD_PADCMDS_H__ -u32 PadIsSupported(padState_t *pstate); -u32 ReadData(padState_t *pstate); -u32 QueryModel(padState_t *pstate); -u32 SetMainMode(padState_t *pstate); -u32 QueryAct(u32 actuator, padState_t *pstate); -u32 QueryComb(u32 val, padState_t *pstate); -u32 QueryMode(u32 val, padState_t *pstate); -u32 EnterConfigMode(u8 val, padState_t *pstate); -u32 ExitConfigMode(padState_t *pstate); -u32 SetActAlign(padState_t *pstate); -u32 QueryButtonMask(padState_t *pstate); -u32 VrefParam(u32 val, padState_t *pstate); -u32 SetButtonInfo(padState_t *pstate); +extern u32 PadIsSupported(padState_t *pstate); +extern u32 ReadData(padState_t *pstate); +extern u32 QueryModel(padState_t *pstate); +extern u32 SetMainMode(padState_t *pstate); +extern u32 QueryAct(u32 actuator, padState_t *pstate); +extern u32 QueryComb(u32 val, padState_t *pstate); +extern u32 QueryMode(u32 val, padState_t *pstate); +extern u32 EnterConfigMode(u8 val, padState_t *pstate); +extern u32 ExitConfigMode(padState_t *pstate); +extern u32 SetActAlign(padState_t *pstate); +extern u32 QueryButtonMask(padState_t *pstate); +extern u32 VrefParam(u32 val, padState_t *pstate); +extern u32 SetButtonInfo(padState_t *pstate); #endif diff --git a/iop/system/padman/src/padData.h b/iop/system/padman/src/padData.h index 5f369b84cab..f313e6e9d99 100644 --- a/iop/system/padman/src/padData.h +++ b/iop/system/padman/src/padData.h @@ -13,33 +13,33 @@ #define __FREEPAD_PADDATA_H__ -void pdReset(void); -void pdTransfer(void); +extern void pdReset(void); +extern void pdTransfer(void); -u32 pdSetCtrl1(u32 port, u32 slot, u32 ctrl); -u32 pdSetCtrl2(u32 port, u32 slot, u32 ctrl); +extern u32 pdSetCtrl1(u32 port, u32 slot, u32 ctrl); +extern u32 pdSetCtrl2(u32 port, u32 slot, u32 ctrl); -u32 pdSetInBuffer(u32 port, u32 slot, u32 size, const u8 *buf); -u32 pdGetOutBuffer(u32 port, u32 slot, u32 size, u8 *buf); +extern u32 pdSetInBuffer(u32 port, u32 slot, u32 size, const u8 *buf); +extern u32 pdGetOutBuffer(u32 port, u32 slot, u32 size, u8 *buf); -u32 pdSetInSize(u32 port, u32 slot, u32 size); -u32 pdSetOutSize(u32 port, u32 slot, u32 size); +extern u32 pdSetInSize(u32 port, u32 slot, u32 size); +extern u32 pdSetOutSize(u32 port, u32 slot, u32 size); -u32 pdGetInSize(u8 id); -u32 pdGetOutSize(u8 id); +extern u32 pdGetInSize(u8 id); +extern u32 pdGetOutSize(u8 id); -u32 pdSetRegData(u32 port, u32 slot, u32 reg_data); -u32 pdGetRegData(u32 id); +extern u32 pdSetRegData(u32 port, u32 slot, u32 reg_data); +extern u32 pdGetRegData(u32 id); -u32 pdIsActive(u32 port, u32 slot); -u32 pdSetActive(u32 port, u32 slot, u32 active); +extern u32 pdIsActive(u32 port, u32 slot); +extern u32 pdSetActive(u32 port, u32 slot, u32 active); -u32 pdGetStat70bit(u32 port, u32 slot); -u32 pdSetStat70bit(u32 port, u32 slot, u32 val); +extern u32 pdGetStat70bit(u32 port, u32 slot); +extern u32 pdSetStat70bit(u32 port, u32 slot, u32 val); -s32 pdGetError(u32 port, u32 slot); +extern s32 pdGetError(u32 port, u32 slot); -u32 pdCheckConnection(u32 port, u32 slot); +extern u32 pdCheckConnection(u32 port, u32 slot); diff --git a/iop/system/padman/src/rpcserver.h b/iop/system/padman/src/rpcserver.h index c6832b6278c..daa195a005d 100644 --- a/iop/system/padman/src/rpcserver.h +++ b/iop/system/padman/src/rpcserver.h @@ -12,6 +12,6 @@ #ifndef __FREEPAD_RPC_SERVER_H__ #define __FREEPAD_RPC_SERVER_H__ -int InitRpcServers(int prio); +extern int InitRpcServers(int prio); #endif diff --git a/iop/system/padman/src/sio2Cmds.h b/iop/system/padman/src/sio2Cmds.h index bed18d2710b..fcaad3a958d 100644 --- a/iop/system/padman/src/sio2Cmds.h +++ b/iop/system/padman/src/sio2Cmds.h @@ -31,35 +31,35 @@ #define PAD_ID_HI(id) ((id)>>4) #define PAD_ID_LO(id) ((id)&0xF) -void sio2cmdReset(void); -void sio2cmdInitFindPads(void); -void sio2cmdInitMouse(void); -void sio2cmdInitNegicon(void); -void sio2cmdInitKonamiGun(void); -void sio2cmdInitDigital(void); -void sio2cmdInitJoystick(void); -void sio2cmdInitNamcoGun(void); -void sio2cmdInitAnalog(void); -void sio2cmdInitJogcon(void); -void sio2cmdInitConfig(void); +extern void sio2cmdReset(void); +extern void sio2cmdInitFindPads(void); +extern void sio2cmdInitMouse(void); +extern void sio2cmdInitNegicon(void); +extern void sio2cmdInitKonamiGun(void); +extern void sio2cmdInitDigital(void); +extern void sio2cmdInitJoystick(void); +extern void sio2cmdInitNamcoGun(void); +extern void sio2cmdInitAnalog(void); +extern void sio2cmdInitJogcon(void); +extern void sio2cmdInitConfig(void); -u32 sio2cmdCheckId(u8 id); +extern u32 sio2cmdCheckId(u8 id); -void sio2CmdSetReadData(u32 id, u8 *buf); -u32 sio2CmdSetEnterConfigMode(u32 id, u8 *buf); -u32 sio2CmdSetExitConfigMode(u32 id, u8 *buf); -u32 sio2CmdSetQueryModel(u32 id, u8 *buf); -u32 sio2CmdSetQueryAct(u32 id, u8 *buf); -u32 sio2CmdSetQueryComb(u32 id, u8 *buf); -u32 sio2CmdSetQueryMode(u32 id, u8 *buf); -u32 sio2CmdSetQueryButtonMask(u32 id, u8 *buf); -u32 sio2CmdSetSetButtonInfo(u32 id, u8 *buf); -u32 sio2CmdSetSetVrefParam(u32 id, u8 *buf); -u32 sio2CmdSetSetMainMode(u32 id, u8 *buf); -u32 sio2CmdSetSetActAlign(u32 id, u8 *buf); +extern void sio2CmdSetReadData(u32 id, u8 *buf); +extern u32 sio2CmdSetEnterConfigMode(u32 id, u8 *buf); +extern u32 sio2CmdSetExitConfigMode(u32 id, u8 *buf); +extern u32 sio2CmdSetQueryModel(u32 id, u8 *buf); +extern u32 sio2CmdSetQueryAct(u32 id, u8 *buf); +extern u32 sio2CmdSetQueryComb(u32 id, u8 *buf); +extern u32 sio2CmdSetQueryMode(u32 id, u8 *buf); +extern u32 sio2CmdSetQueryButtonMask(u32 id, u8 *buf); +extern u32 sio2CmdSetSetButtonInfo(u32 id, u8 *buf); +extern u32 sio2CmdSetSetVrefParam(u32 id, u8 *buf); +extern u32 sio2CmdSetSetMainMode(u32 id, u8 *buf); +extern u32 sio2CmdSetSetActAlign(u32 id, u8 *buf); -u32 sio2CmdGetPortCtrl1(u8 id, u32 b, u8 c); -u32 sio2CmdGetPortCtrl2(u32 id, u32 b); +extern u32 sio2CmdGetPortCtrl1(u8 id, u32 b, u8 c); +extern u32 sio2CmdGetPortCtrl2(u32 id, u32 b); #endif diff --git a/iop/system/rmman/include/rmman.h b/iop/system/rmman/include/rmman.h index b430ce9c9e8..05b22c47abc 100644 --- a/iop/system/rmman/include/rmman.h +++ b/iop/system/rmman/include/rmman.h @@ -20,10 +20,10 @@ #include #include -int rmmanInit(void); -int rmmanOpen(int port, int slot, void *buffer); -int rmmanClose(int port, int slot); -int rmmanEnd(void); +extern int rmmanInit(void); +extern int rmmanOpen(int port, int slot, void *buffer); +extern int rmmanClose(int port, int slot); +extern int rmmanEnd(void); #define rmman_IMPORTS_start DECLARE_IMPORT_TABLE(rmman, 1, 1) #define rmman_IMPORTS_end END_IMPORT_TABLE diff --git a/iop/system/rsio2man/include/rsio2man.h b/iop/system/rsio2man/include/rsio2man.h index 3d91190d306..b604a252891 100644 --- a/iop/system/rsio2man/include/rsio2man.h +++ b/iop/system/rsio2man/include/rsio2man.h @@ -21,8 +21,8 @@ #include #undef NO_XSIO2MAN_IMPORTS -void sio2_rm_transfer_init(void); -void sio2_unk_transfer_init(void); +extern void sio2_rm_transfer_init(void); +extern void sio2_unk_transfer_init(void); #define rsio2man_IMPORTS_start DECLARE_IMPORT_TABLE(sio2man, 2, 3) #define rsio2man_IMPORTS_end END_IMPORT_TABLE diff --git a/iop/system/sbusintr/include/sbusintr.h b/iop/system/sbusintr/include/sbusintr.h index d367d061abd..efc352b4925 100644 --- a/iop/system/sbusintr/include/sbusintr.h +++ b/iop/system/sbusintr/include/sbusintr.h @@ -33,13 +33,13 @@ enum sbus_errors { typedef int (*sbus_intr_handler_t)(u32, void *); -int sbus_intr_init(); -void sbus_intr_exit(); +extern int sbus_intr_init(); +extern void sbus_intr_exit(); -int sbus_intr_handler_add(u32 irq, sbus_intr_handler_t handler, void *arg); -int sbus_intr_handler_del(u32 irq); +extern int sbus_intr_handler_add(u32 irq, sbus_intr_handler_t handler, void *arg); +extern int sbus_intr_handler_del(u32 irq); -void sbus_intr_main_interrupt(u32 irq); +extern void sbus_intr_main_interrupt(u32 irq); #define sbusintr_IMPORTS_start DECLARE_IMPORT_TABLE(sbusintr, 1, 1) #define sbusintr_IMPORTS_end END_IMPORT_TABLE diff --git a/iop/system/siftoo/include/siftoo.h b/iop/system/siftoo/include/siftoo.h index b2c23f1261b..bf9222e986e 100644 --- a/iop/system/siftoo/include/siftoo.h +++ b/iop/system/siftoo/include/siftoo.h @@ -29,20 +29,20 @@ enum sif2_errors { typedef int (*sif2_pipe_handler_t)(u32, void *, u32); -int sif2_init(void); -int sif2_exit(void); +extern int sif2_init(void); +extern int sif2_exit(void); -int sif2_mem_read(u32 addr, void *buf, u32 size); -int sif2_mem_write(u32 addr, void *buf, u32 size); +extern int sif2_mem_read(u32 addr, void *buf, u32 size); +extern int sif2_mem_write(u32 addr, void *buf, u32 size); /* Pipe API. */ -int sif2_pipe_create(u32 id, void *buf, u32 size, u32 flags, +extern int sif2_pipe_create(u32 id, void *buf, u32 size, u32 flags, sif2_pipe_handler_t phandler); -int sif2_pipe_open(u32 id); -int sif2_pipe_close(int pd); +extern int sif2_pipe_open(u32 id); +extern int sif2_pipe_close(int pd); -int sif2_pipe_read(int pd, void *buf, u32 size); -int sif2_pipe_write(int pd, void *buf, u32 size); +extern int sif2_pipe_read(int pd, void *buf, u32 size); +extern int sif2_pipe_write(int pd, void *buf, u32 size); #define siftoo_IMPORTS_start DECLARE_IMPORT_TABLE(siftoo, 1, 1) #define siftoo_IMPORTS_end END_IMPORT_TABLE diff --git a/iop/system/sio2man/include/log.h b/iop/system/sio2man/include/log.h index f4dff6a0885..aa7b87a684f 100644 --- a/iop/system/sio2man/include/log.h +++ b/iop/system/sio2man/include/log.h @@ -28,15 +28,15 @@ enum _log_types { LOG_RESET }; -void log_write8(u8 val); -void log_write32(u32 val); -void log_flush(int now); - -void log_default(int type); -void log_portdata(u32 *pd1, u32 *pd2); -void log_regdata(u32 *rd); -void log_data(int type, u8 *data, u32 size); -void log_dma(int type, struct _sio2_dma_arg *arg); -void log_stat(u32 stat6c, u32 stat70, u32 stat74); +extern void log_write8(u8 val); +extern void log_write32(u32 val); +extern void log_flush(int now); + +extern void log_default(int type); +extern void log_portdata(u32 *pd1, u32 *pd2); +extern void log_regdata(u32 *rd); +extern void log_data(int type, u8 *data, u32 size); +extern void log_dma(int type, struct _sio2_dma_arg *arg); +extern void log_stat(u32 stat6c, u32 stat70, u32 stat74); #endif /* SIO2LOG_LOG_H */ diff --git a/iop/system/sio2man/include/sio2man.h b/iop/system/sio2man/include/sio2man.h index 2ed3b27c6a8..3f7948c66f9 100644 --- a/iop/system/sio2man/include/sio2man.h +++ b/iop/system/sio2man/include/sio2man.h @@ -46,28 +46,28 @@ typedef struct { struct _sio2_dma_arg out_dma; } sio2_transfer_data_t; -void sio2_ctrl_set(u32 val); -u32 sio2_ctrl_get(void); -u32 sio2_stat6c_get(void); -void sio2_portN_ctrl1_set(int N, u32 val); -u32 sio2_portN_ctrl1_get(int N); -void sio2_portN_ctrl2_set(int N, u32 val); -u32 sio2_portN_ctrl2_get(int N); -u32 sio2_stat70_get(void); -void sio2_regN_set(int N, u32 val); -u32 sio2_regN_get(int N); -u32 sio2_stat74_get(void); -void sio2_unkn78_set(u32 val); -u32 sio2_unkn78_get(void); -void sio2_unkn7c_set(u32 val); -u32 sio2_unkn7c_get(void); -void sio2_data_out(u8 val); -u8 sio2_data_in(void); -void sio2_stat_set(u32 val); -u32 sio2_stat_get(void); -void sio2_pad_transfer_init(void); -void sio2_mc_transfer_init(void); -int sio2_transfer(sio2_transfer_data_t *td); +extern void sio2_ctrl_set(u32 val); +extern u32 sio2_ctrl_get(void); +extern u32 sio2_stat6c_get(void); +extern void sio2_portN_ctrl1_set(int N, u32 val); +extern u32 sio2_portN_ctrl1_get(int N); +extern void sio2_portN_ctrl2_set(int N, u32 val); +extern u32 sio2_portN_ctrl2_get(int N); +extern u32 sio2_stat70_get(void); +extern void sio2_regN_set(int N, u32 val); +extern u32 sio2_regN_get(int N); +extern u32 sio2_stat74_get(void); +extern void sio2_unkn78_set(u32 val); +extern u32 sio2_unkn78_get(void); +extern void sio2_unkn7c_set(u32 val); +extern u32 sio2_unkn7c_get(void); +extern void sio2_data_out(u8 val); +extern u8 sio2_data_in(void); +extern void sio2_stat_set(u32 val); +extern u32 sio2_stat_get(void); +extern void sio2_pad_transfer_init(void); +extern void sio2_mc_transfer_init(void); +extern int sio2_transfer(sio2_transfer_data_t *td); #define sio2man_IMPORTS_start DECLARE_IMPORT_TABLE(sio2man, 1, 1) #define sio2man_IMPORTS_end END_IMPORT_TABLE diff --git a/iop/system/threadman/src/thcommon.h b/iop/system/threadman/src/thcommon.h index 0afffb84712..a740cd8b34b 100644 --- a/iop/system/threadman/src/thcommon.h +++ b/iop/system/threadman/src/thcommon.h @@ -272,27 +272,27 @@ static inline void readyq_remove(struct thread *thread, u32 prio) list_remove(&thread->queue); } -u32 readyq_highest(); +extern u32 readyq_highest(); -struct alarm *alarm_alloc(); -void alarm_free(struct alarm *alarm); -void alarm_insert(struct list_head *list, struct alarm *alarm); +extern struct alarm *alarm_alloc(); +extern void alarm_free(struct alarm *alarm); +extern void alarm_insert(struct list_head *list, struct alarm *alarm); -void update_timer_compare(int timid, u64 time, struct list_head *alarm_list); +extern void update_timer_compare(int timid, u64 time, struct list_head *alarm_list); -void *heap_alloc(u16 tag, u32 bytes); -int heap_free(struct heaptag *tag); +extern void *heap_alloc(u16 tag, u32 bytes); +extern int heap_free(struct heaptag *tag); -int thread_start(struct thread *thread, int intr_state); -int thread_init_and_start(struct thread *thread, int intr_state); -int thread_leave(int unk, int unk2, int intr_state, int release); +extern int thread_start(struct thread *thread, int intr_state); +extern int thread_init_and_start(struct thread *thread, int intr_state); +extern int thread_leave(int unk, int unk2, int intr_state, int release); -unsigned int thread_delay_cb(void *user); +extern unsigned int thread_delay_cb(void *user); -int read_sys_time(iop_sys_clock_t *clock); +extern int read_sys_time(iop_sys_clock_t *clock); -void waitlist_insert(struct thread *thread, struct event *event, s32 priority); +extern void waitlist_insert(struct thread *thread, struct event *event, s32 priority); -int check_thread_stack(); +extern int check_thread_stack(); #endif // THCOMMON_H_ diff --git a/iop/tcpip/tcpip-base/include/arch/sys_arch.h b/iop/tcpip/tcpip-base/include/arch/sys_arch.h index 0b23336d743..af01605f5ca 100644 --- a/iop/tcpip/tcpip-base/include/arch/sys_arch.h +++ b/iop/tcpip/tcpip-base/include/arch/sys_arch.h @@ -17,8 +17,8 @@ typedef struct st_arch_message void *sys_msg; } arch_message; -void *malloc(size_t size); -void free(void *ptr); -void *calloc(size_t n, size_t size); +extern void *malloc(size_t size); +extern void free(void *ptr); +extern void *calloc(size_t n, size_t size); #endif /* __SYS_ARCH_H__ */ diff --git a/iop/tcpip/tcpip/include/ps2ip.h b/iop/tcpip/tcpip/include/ps2ip.h index 7fbc6890e35..02897051ddf 100644 --- a/iop/tcpip/tcpip/include/ps2ip.h +++ b/iop/tcpip/tcpip/include/ps2ip.h @@ -25,43 +25,43 @@ /* From include/lwip/sockets.h: */ -int lwip_accept(int s, struct sockaddr *addr, socklen_t *addrlen); -int lwip_bind(int s, struct sockaddr *name, socklen_t namelen); -int lwip_close(int s); -int lwip_connect(int s, struct sockaddr *name, socklen_t namelen); -int lwip_listen(int s, int backlog); -int lwip_recv(int s, void *mem, int len, unsigned int flags); -int lwip_recvfrom(int s, void *mem, int len, unsigned int flags, +extern int lwip_accept(int s, struct sockaddr *addr, socklen_t *addrlen); +extern int lwip_bind(int s, struct sockaddr *name, socklen_t namelen); +extern int lwip_close(int s); +extern int lwip_connect(int s, struct sockaddr *name, socklen_t namelen); +extern int lwip_listen(int s, int backlog); +extern int lwip_recv(int s, void *mem, int len, unsigned int flags); +extern int lwip_recvfrom(int s, void *mem, int len, unsigned int flags, struct sockaddr *from, socklen_t *fromlen); -int lwip_send(int s, void *dataptr, int size, unsigned int flags); -int lwip_sendto(int s, void *dataptr, int size, unsigned int flags, +extern int lwip_send(int s, void *dataptr, int size, unsigned int flags); +extern int lwip_sendto(int s, void *dataptr, int size, unsigned int flags, struct sockaddr *to, socklen_t tolen); -int lwip_socket(int domain, int type, int protocol); -int lwip_select(int maxfdp1, fd_set *readset, fd_set *writeset, fd_set *exceptset, +extern int lwip_socket(int domain, int type, int protocol); +extern int lwip_select(int maxfdp1, fd_set *readset, fd_set *writeset, fd_set *exceptset, struct timeval *timeout); -int lwip_ioctl(int s, long cmd, void *argp); -int lwip_getpeername (int s, struct sockaddr *name, socklen_t *namelen); -int lwip_getsockname (int s, struct sockaddr *name, socklen_t *namelen); -int lwip_getsockopt (int s, int level, int optname, void *optval, socklen_t *optlen); -int lwip_setsockopt (int s, int level, int optname, const void *optval, socklen_t optlen); +extern int lwip_ioctl(int s, long cmd, void *argp); +extern int lwip_getpeername (int s, struct sockaddr *name, socklen_t *namelen); +extern int lwip_getsockname (int s, struct sockaddr *name, socklen_t *namelen); +extern int lwip_getsockopt (int s, int level, int optname, void *optval, socklen_t *optlen); +extern int lwip_setsockopt (int s, int level, int optname, const void *optval, socklen_t optlen); -int ps2ip_setconfig(const t_ip_info* ip_info); -int ps2ip_getconfig(char* netif_name,t_ip_info* ip_info); -void ps2ip_input(struct pbuf *p, struct netif *inp); +extern int ps2ip_setconfig(const t_ip_info* ip_info); +extern int ps2ip_getconfig(char* netif_name,t_ip_info* ip_info); +extern void ps2ip_input(struct pbuf *p, struct netif *inp); -int lwip_shutdown(int s, int how); -int lwip_fcntl(int s, int cmd, int val); +extern int lwip_shutdown(int s, int how); +extern int lwip_fcntl(int s, int cmd, int val); /* From include/netif/etharp.h: */ -err_t etharp_output(struct netif *netif, struct pbuf *q, const ip_addr_t *ipaddr); +extern err_t etharp_output(struct netif *netif, struct pbuf *q, const ip_addr_t *ipaddr); /* From include/lwip/tcpip.h: */ -err_t tcpip_input(struct pbuf *p, struct netif *inp); +extern err_t tcpip_input(struct pbuf *p, struct netif *inp); /** Function prototype for functions passed to tcpip_callback() */ typedef void (*tcpip_callback_fn)(void *ctx); -err_t tcpip_callback_with_block(tcpip_callback_fn function, void *ctx, u8 block); +extern err_t tcpip_callback_with_block(tcpip_callback_fn function, void *ctx, u8 block); /** * @ingroup lwip_os @@ -70,7 +70,7 @@ err_t tcpip_callback_with_block(tcpip_callback_fn function, void *ctx, u8 block #define tcpip_callback(f, ctx) tcpip_callback_with_block(f, ctx, 1) /* From include/lwip/netif.h: */ -struct netif *netif_add(struct netif *netif, +extern struct netif *netif_add(struct netif *netif, #if LWIP_IPV4 const ip4_addr_t *ipaddr, const ip4_addr_t *netmask, const ip4_addr_t *gw, #endif /* LWIP_IPV4 */ @@ -80,28 +80,28 @@ struct netif *netif_add(struct netif *netif, "et0", where the first two letters are the "name" field in the netif structure, and the digit is in the num field in the same structure. */ -struct netif* netif_find(const char *name); -void netif_set_default(struct netif *netif); -void netif_set_ipaddr(struct netif *netif, const ip4_addr_t *ipaddr); -void netif_set_netmask(struct netif *netif, const ip4_addr_t *netmask); -void netif_set_gw(struct netif *netif, const ip4_addr_t *gw); -void netif_set_up(struct netif *netif); -void netif_set_down(struct netif *netif); +extern struct netif* netif_find(const char *name); +extern void netif_set_default(struct netif *netif); +extern void netif_set_ipaddr(struct netif *netif, const ip4_addr_t *ipaddr); +extern void netif_set_netmask(struct netif *netif, const ip4_addr_t *netmask); +extern void netif_set_gw(struct netif *netif, const ip4_addr_t *gw); +extern void netif_set_up(struct netif *netif); +extern void netif_set_down(struct netif *netif); -void netif_set_link_up(struct netif *netif); -void netif_set_link_down(struct netif *netif); +extern void netif_set_link_up(struct netif *netif); +extern void netif_set_link_down(struct netif *netif); /* From include/lwip/pbuf.h: */ -struct pbuf* pbuf_alloc(pbuf_layer l, u16 size, pbuf_type type); -void pbuf_realloc(struct pbuf *p, u16 size); -u8 pbuf_header(struct pbuf *p, s16 header_size); -void pbuf_ref(struct pbuf *p); -u8 pbuf_free(struct pbuf *p); -u8 pbuf_clen(struct pbuf *p); -void pbuf_chain(struct pbuf *h, struct pbuf *t); -struct pbuf* pbuf_dechain(struct pbuf *p); -struct pbuf* pbuf_take(struct pbuf *f); -struct pbuf* pbuf_coalesce(struct pbuf *p, pbuf_layer layer); +extern struct pbuf* pbuf_alloc(pbuf_layer l, u16 size, pbuf_type type); +extern void pbuf_realloc(struct pbuf *p, u16 size); +extern u8 pbuf_header(struct pbuf *p, s16 header_size); +extern void pbuf_ref(struct pbuf *p); +extern u8 pbuf_free(struct pbuf *p); +extern u8 pbuf_clen(struct pbuf *p); +extern void pbuf_chain(struct pbuf *h, struct pbuf *t); +extern struct pbuf* pbuf_dechain(struct pbuf *p); +extern struct pbuf* pbuf_take(struct pbuf *f); +extern struct pbuf* pbuf_coalesce(struct pbuf *p, pbuf_layer layer); /* From include/lwip/inet.h: */ /* directly map this to the lwip internal functions */ @@ -110,26 +110,26 @@ struct pbuf* pbuf_coalesce(struct pbuf *p, pbuf_layer layer); #define inet_ntoa(addr) ip4addr_ntoa((const ip4_addr_t*)&(addr)) #define inet_ntoa_r(addr, buf, buflen) ip4addr_ntoa_r((const ip4_addr_t*)&(addr), buf, buflen) -u32 ipaddr_addr(const char *cp); -int ip4addr_aton(const char *cp, ip4_addr_t *addr); +extern u32 ipaddr_addr(const char *cp); +extern int ip4addr_aton(const char *cp, ip4_addr_t *addr); /** returns ptr to static buffer; not reentrant! */ -char *ip4addr_ntoa(const ip4_addr_t *addr); -char *ip4addr_ntoa_r(const ip4_addr_t *addr, char *buf, int buflen); +extern char *ip4addr_ntoa(const ip4_addr_t *addr); +extern char *ip4addr_ntoa_r(const ip4_addr_t *addr, char *buf, int buflen); #ifdef PS2IP_DNS /* From include/lwip/netdb.h: */ -struct hostent *lwip_gethostbyname(const char *name); -int lwip_gethostbyname_r(const char *name, struct hostent *ret, char *buf, +extern struct hostent *lwip_gethostbyname(const char *name); +extern int lwip_gethostbyname_r(const char *name, struct hostent *ret, char *buf, size_t buflen, struct hostent **result, int *h_errnop); -void lwip_freeaddrinfo(struct addrinfo *ai); -int lwip_getaddrinfo(const char *nodename, +extern void lwip_freeaddrinfo(struct addrinfo *ai); +extern int lwip_getaddrinfo(const char *nodename, const char *servname, const struct addrinfo *hints, struct addrinfo **res); /* From include/lwip/dns.h: */ -void dns_setserver(u8 numdns, const ip_addr_t *dnsserver); -const ip_addr_t* dns_getserver(u8 numdns); +extern void dns_setserver(u8 numdns, const ip_addr_t *dnsserver); +extern const ip_addr_t* dns_getserver(u8 numdns); #endif /* Compatibility macros. */ diff --git a/iop/usb/camera/include/ps2cam.h b/iop/usb/camera/include/ps2cam.h index 57d964d2498..9c0a60c3950 100644 --- a/iop/usb/camera/include/ps2cam.h +++ b/iop/usb/camera/include/ps2cam.h @@ -233,56 +233,56 @@ typedef struct ((unsigned char)(vdiv) <<4)|\ ((unsigned char)(en_sa) <<7)); -void rpcMainThread(void* param); -void *rpcCommandHandler(u32 command, void *buffer, int size); +extern void rpcMainThread(void* param); +extern void *rpcCommandHandler(u32 command, void *buffer, int size); // usbd.irx calls -int PS2CamInitDriver(); -int PS2CamProbe(int devId); -int PS2CamConnect(int devId); -int PS2CamDisconnect(int devId); -void PS2CamGetDeviceSring(CAMERA_DEVICE* dev, int index, char *str, int strmax); +extern int PS2CamInitDriver(); +extern int PS2CamProbe(int devId); +extern int PS2CamConnect(int devId); +extern int PS2CamDisconnect(int devId); +extern void PS2CamGetDeviceSring(CAMERA_DEVICE* dev, int index, char *str, int strmax); //private funtions -void PS2CamCallback(int resultCode, int bytes, void *arg); -void PS2CamSetDeviceConfiguration(CAMERA_DEVICE *dev,int id); -void PS2CamInitializeNewDevice(CAMERA_DEVICE *argv); -void PS2CamSetDeviceDefaults(CAMERA_DEVICE *dev); -int PS2CamGetIRXVersion(void); -int PS2CamInit(int mode); -int PS2CamGetDeviceCount(void); -int PS2CamOpenDevice(int device_index); -int PS2CamCloseDevice(int handle); -int PS2CamGetDeviceInfo(int handle,int *info); +extern void PS2CamCallback(int resultCode, int bytes, void *arg); +extern void PS2CamSetDeviceConfiguration(CAMERA_DEVICE *dev,int id); +extern void PS2CamInitializeNewDevice(CAMERA_DEVICE *argv); +extern void PS2CamSetDeviceDefaults(CAMERA_DEVICE *dev); +extern int PS2CamGetIRXVersion(void); +extern int PS2CamInit(int mode); +extern int PS2CamGetDeviceCount(void); +extern int PS2CamOpenDevice(int device_index); +extern int PS2CamCloseDevice(int handle); +extern int PS2CamGetDeviceInfo(int handle,int *info); // low level camera funtions -int setReg8(CAMERA_DEVICE *dev, unsigned char reg_id, unsigned char value); -int getReg8(CAMERA_DEVICE *dev, unsigned char reg_id, unsigned char *value); -int setReg8Mask(CAMERA_DEVICE *dev, unsigned char reg_id, unsigned char value,unsigned char mask); -int setReg16(CAMERA_DEVICE *dev, unsigned char reg_id, unsigned short value); -int PS2CamSelectInterface(CAMERA_DEVICE* dev, int interface, int altSetting); +extern int setReg8(CAMERA_DEVICE *dev, unsigned char reg_id, unsigned char value); +extern int getReg8(CAMERA_DEVICE *dev, unsigned char reg_id, unsigned char *value); +extern int setReg8Mask(CAMERA_DEVICE *dev, unsigned char reg_id, unsigned char value,unsigned char mask); +extern int setReg16(CAMERA_DEVICE *dev, unsigned char reg_id, unsigned short value); +extern int PS2CamSelectInterface(CAMERA_DEVICE* dev, int interface, int altSetting); -void camResetDevice(CAMERA_DEVICE *dev); -void camEnableAutoLaunch(CAMERA_DEVICE *dev); -void camDisableAutoLaunch(CAMERA_DEVICE *dev); -void camClearSnapButton(CAMERA_DEVICE *dev); -int camCheckAutoLaunch(CAMERA_DEVICE *dev); -void camEnableSystem(CAMERA_DEVICE *dev); -void camDisableSystem(CAMERA_DEVICE *dev); -void camResetUsb(CAMERA_DEVICE *dev); -void camSetUsbInit(CAMERA_DEVICE *dev); -void camSetUsbWork(CAMERA_DEVICE *dev); -void camTurnOnRedLed(CAMERA_DEVICE *dev); -void camTurnOffRedLed(CAMERA_DEVICE *dev); -void camBlockStream(CAMERA_DEVICE *dev); -void camStartStream(CAMERA_DEVICE *dev); -void camStopStream(CAMERA_DEVICE *dev); +extern void camResetDevice(CAMERA_DEVICE *dev); +extern void camEnableAutoLaunch(CAMERA_DEVICE *dev); +extern void camDisableAutoLaunch(CAMERA_DEVICE *dev); +extern void camClearSnapButton(CAMERA_DEVICE *dev); +extern int camCheckAutoLaunch(CAMERA_DEVICE *dev); +extern void camEnableSystem(CAMERA_DEVICE *dev); +extern void camDisableSystem(CAMERA_DEVICE *dev); +extern void camResetUsb(CAMERA_DEVICE *dev); +extern void camSetUsbInit(CAMERA_DEVICE *dev); +extern void camSetUsbWork(CAMERA_DEVICE *dev); +extern void camTurnOnRedLed(CAMERA_DEVICE *dev); +extern void camTurnOffRedLed(CAMERA_DEVICE *dev); +extern void camBlockStream(CAMERA_DEVICE *dev); +extern void camStartStream(CAMERA_DEVICE *dev); +extern void camStopStream(CAMERA_DEVICE *dev); // PS2Cam rpc/export funtions -int PS2CamReadPacket(int device_id); -int PS2CamGetDeviceStatus(int device_id); -int PS2CamSetDeviceBandwidth(int device_id, char bandwidth); -int PS2CamSetLEDMode(int device_id, int mode); -int PS2CamSetDeviceConfig(int handle, void *config); +extern int PS2CamReadPacket(int device_id); +extern int PS2CamGetDeviceStatus(int device_id); +extern int PS2CamSetDeviceBandwidth(int device_id, char bandwidth); +extern int PS2CamSetLEDMode(int device_id, int mode); +extern int PS2CamSetDeviceConfig(int handle, void *config); #endif /* __PS2CAM_H__ */ diff --git a/iop/usb/usbd/include/usbd.h b/iop/usb/usbd/include/usbd.h index 8cf542bc097..7e62ad2af1f 100644 --- a/iop/usb/usbd/include/usbd.h +++ b/iop/usb/usbd/include/usbd.h @@ -293,24 +293,24 @@ typedef void (*sceUsbdMultiIsochronousDoneCallback)(int result, sceUsbdMultiIsoc /** Unknown Error (USBD.IRX doesn't know what went wrong) */ #define USB_RC_UNKNOWN 0x132 -int sceUsbdRegisterLdd(sceUsbdLddOps *driver); -int sceUsbdUnregisterLdd(sceUsbdLddOps *driver); -void *sceUsbdScanStaticDescriptor(int devId, void *data, u8 type); -int sceUsbdGetDeviceLocation(int devId, u8 *path); -int sceUsbdSetPrivateData(int devId, void *data); -void *sceUsbdGetPrivateData(int devId); -int sceUsbdOpenPipe(int devId, UsbEndpointDescriptor *desc); -int sceUsbdOpenPipeAligned(int devId, UsbEndpointDescriptor *desc); -int sceUsbdClosePipe(int id); -int sceUsbdTransferPipe(int id, void *data, u32 len, void *option, sceUsbdDoneCallback callback, void *cbArg); - -int sceUsbdRegisterAutoloader(sceUsbdLddOps *drv); // Arbitrarily named -int sceUsbdUnregisterAutoloader(void); // Arbitrarily named -int sceUsbdChangeThreadPriority(int prio1, int prio2); +extern int sceUsbdRegisterLdd(sceUsbdLddOps *driver); +extern int sceUsbdUnregisterLdd(sceUsbdLddOps *driver); +extern void *sceUsbdScanStaticDescriptor(int devId, void *data, u8 type); +extern int sceUsbdGetDeviceLocation(int devId, u8 *path); +extern int sceUsbdSetPrivateData(int devId, void *data); +extern void *sceUsbdGetPrivateData(int devId); +extern int sceUsbdOpenPipe(int devId, UsbEndpointDescriptor *desc); +extern int sceUsbdOpenPipeAligned(int devId, UsbEndpointDescriptor *desc); +extern int sceUsbdClosePipe(int id); +extern int sceUsbdTransferPipe(int id, void *data, u32 len, void *option, sceUsbdDoneCallback callback, void *cbArg); + +extern int sceUsbdRegisterAutoloader(sceUsbdLddOps *drv); // Arbitrarily named +extern int sceUsbdUnregisterAutoloader(void); // Arbitrarily named +extern int sceUsbdChangeThreadPriority(int prio1, int prio2); // These have been added in 1.2 export version -int sceUsbdGetReportDescriptor(int devId, int cfgNum, int ifNum, void **desc, u32 *len); -int sceUsbdMultiIsochronousTransfer(int pipeId, sceUsbdMultiIsochronousRequest *request, sceUsbdMultiIsochronousDoneCallback callback, void *cbArg); +extern int sceUsbdGetReportDescriptor(int devId, int cfgNum, int ifNum, void **desc, u32 *len); +extern int sceUsbdMultiIsochronousTransfer(int pipeId, sceUsbdMultiIsochronousRequest *request, sceUsbdMultiIsochronousDoneCallback callback, void *cbArg); // For backwards compatibility: #define UsbCallbackProc sceUsbdDoneCallback diff --git a/iop/usb/usbhdfsd/include/usbhdfsd.h b/iop/usb/usbhdfsd/include/usbhdfsd.h index 21c09c77e4b..6f31a3419d8 100644 --- a/iop/usb/usbhdfsd/include/usbhdfsd.h +++ b/iop/usb/usbhdfsd/include/usbhdfsd.h @@ -128,13 +128,13 @@ typedef struct _fat_driver } fat_driver; // Exported functions -int UsbMassGetDeviceInfo(int device, UsbMassDeviceInfo_t *info); -int UsbMassRegisterCallback(int device, usbmass_cb_t callback); -fat_driver *UsbMassFatGetData(int device); -int UsbMassReadSector(fat_driver *fatd, void **buffer, u32 sector); -int UsbMassWriteSector(fat_driver *fatd, u32 sector); -void UsbMassFlushCache(fat_driver *fatd); -int UsbMassFatGetClusterChain(fat_driver *fatd, unsigned int cluster, unsigned int *buf, unsigned int bufSize, int startFlag); +extern int UsbMassGetDeviceInfo(int device, UsbMassDeviceInfo_t *info); +extern int UsbMassRegisterCallback(int device, usbmass_cb_t callback); +extern fat_driver *UsbMassFatGetData(int device); +extern int UsbMassReadSector(fat_driver *fatd, void **buffer, u32 sector); +extern int UsbMassWriteSector(fat_driver *fatd, u32 sector); +extern void UsbMassFlushCache(fat_driver *fatd); +extern int UsbMassFatGetClusterChain(fat_driver *fatd, unsigned int cluster, unsigned int *buf, unsigned int bufSize, int startFlag); #define usbmass_IMPORTS_start DECLARE_IMPORT_TABLE(usbmass, 1, 2) #define usbmass_IMPORTS_end END_IMPORT_TABLE diff --git a/iop/usb/usbhdfsd/src/include/mass_stor.h b/iop/usb/usbhdfsd/src/include/mass_stor.h index 2a948df4dae..9e76e33378a 100644 --- a/iop/usb/usbhdfsd/src/include/mass_stor.h +++ b/iop/usb/usbhdfsd/src/include/mass_stor.h @@ -1,14 +1,14 @@ #ifndef _MASS_STOR_H #define _MASS_STOR_H 1 -int InitUSB(void); -int mass_stor_disconnect(int devId); -int mass_stor_connect(int devId); -int mass_stor_probe(int devId); -int mass_stor_readSector(mass_dev *dev, unsigned int sector, unsigned char *buffer, unsigned short int count); -int mass_stor_writeSector(mass_dev *dev, unsigned int sector, const unsigned char *buffer, unsigned short int count); -int mass_stor_configureNextDevice(void); -int mass_stor_stop_unit(mass_dev *dev); -void mass_store_stop_all(void); +extern int InitUSB(void); +extern int mass_stor_disconnect(int devId); +extern int mass_stor_connect(int devId); +extern int mass_stor_probe(int devId); +extern int mass_stor_readSector(mass_dev *dev, unsigned int sector, unsigned char *buffer, unsigned short int count); +extern int mass_stor_writeSector(mass_dev *dev, unsigned int sector, const unsigned char *buffer, unsigned short int count); +extern int mass_stor_configureNextDevice(void); +extern int mass_stor_stop_unit(mass_dev *dev); +extern void mass_store_stop_all(void); #endif diff --git a/iop/usb/usbmass_bd/src/include/scsi.h b/iop/usb/usbmass_bd/src/include/scsi.h index 2b99c62f26b..882baf86537 100644 --- a/iop/usb/usbmass_bd/src/include/scsi.h +++ b/iop/usb/usbmass_bd/src/include/scsi.h @@ -11,8 +11,8 @@ struct scsi_interface int (*queue_cmd)(struct scsi_interface *scsi, const unsigned char *cmd, unsigned int cmd_len, unsigned char *data, unsigned int data_len, unsigned int data_wr); }; -int scsi_init(void); -void scsi_connect(struct scsi_interface *scsi); -void scsi_disconnect(struct scsi_interface *scsi); +extern int scsi_init(void); +extern void scsi_connect(struct scsi_interface *scsi); +extern void scsi_disconnect(struct scsi_interface *scsi); #endif diff --git a/skeleton/iop/hello.h b/skeleton/iop/hello.h index 2af0a0c635e..53df366c169 100644 --- a/skeleton/iop/hello.h +++ b/skeleton/iop/hello.h @@ -2,6 +2,6 @@ #define __HELLO_H__ // Let's have a prototype for our export! -void hello(void); +extern void hello(void); #endif diff --git a/tools/ps2adpcm/src/adpcm.h b/tools/ps2adpcm/src/adpcm.h index e5f328bf993..5de38f5b43a 100644 --- a/tools/ps2adpcm/src/adpcm.h +++ b/tools/ps2adpcm/src/adpcm.h @@ -27,9 +27,9 @@ typedef struct int pad; } AdpcmSetup; -AdpcmSetup *AdpcmCreate(AdpcmGetPCMfunc get, void *getpriv, AdpcmPutADPCMfunc put, void *putpriv, int loopstart); -int AdpcmDestroy(AdpcmSetup *set); -int AdpcmEncode(AdpcmSetup *set, int blocks); +extern AdpcmSetup *AdpcmCreate(AdpcmGetPCMfunc get, void *getpriv, AdpcmPutADPCMfunc put, void *putpriv, int loopstart); +extern int AdpcmDestroy(AdpcmSetup *set); +extern int AdpcmEncode(AdpcmSetup *set, int blocks); #endif diff --git a/tools/romimg/src/SonyRX.h b/tools/romimg/src/SonyRX.h index fe6520ef30c..8ef9ae7b436 100644 --- a/tools/romimg/src/SonyRX.h +++ b/tools/romimg/src/SonyRX.h @@ -1,7 +1,7 @@ #ifndef __SONY_RX_H__ #define __SONY_RX_H__ -int IsSonyRXModule(const char *path); -int GetSonyRXModInfo(const char *path, char *description, unsigned int MaxLength, unsigned short int *version); +extern int IsSonyRXModule(const char *path); +extern int GetSonyRXModInfo(const char *path, char *description, unsigned int MaxLength, unsigned short int *version); #endif /* __SONY_RX_H__ */ \ No newline at end of file diff --git a/tools/romimg/src/platform.h b/tools/romimg/src/platform.h index 9d9a5970767..0ba9630b991 100644 --- a/tools/romimg/src/platform.h +++ b/tools/romimg/src/platform.h @@ -1,12 +1,12 @@ #ifndef __PLATFORM_H__ #define __PLATFORM_H__ -int GetUsername(char *buffer, unsigned int BufferSize); -int GetLocalhostName(char *buffer, unsigned int BufferSize); -unsigned int GetSystemDate(void); -unsigned int GetFileCreationDate(const char *path); -int GetCurrentWorkingDirectory(char *buffer, unsigned int BufferSize); -void upperbuff(char *temp); +extern int GetUsername(char *buffer, unsigned int BufferSize); +extern int GetLocalhostName(char *buffer, unsigned int BufferSize); +extern unsigned int GetSystemDate(void); +extern unsigned int GetFileCreationDate(const char *path); +extern int GetCurrentWorkingDirectory(char *buffer, unsigned int BufferSize); +extern void upperbuff(char *temp); #if defined(_WIN32) || defined(WIN32) #define PATHSEP '\\' diff --git a/tools/romimg/src/romimg.h b/tools/romimg/src/romimg.h index ecbabb3ec8f..ae4a4f7e4be 100644 --- a/tools/romimg/src/romimg.h +++ b/tools/romimg/src/romimg.h @@ -64,13 +64,13 @@ typedef struct ImageStructure } ROMIMG; /* Function prototypes */ -int CreateBlankROMImg(const char *filename, ROMIMG *ROMImg); -int WriteROMImg(const char *file, const ROMIMG *ROMImg); -int LoadROMImg(ROMIMG *ROMImg, const char *path); -void UnloadROMImg(ROMIMG *ROMImg); -int AddFile(ROMIMG *ROMImg, const char *path, int upperconv); -int DeleteFile(ROMIMG *ROMImg, const char *filename); -int ExtractFile(const ROMIMG *ROMImg, const char *filename, const char *FileToExtract); -int IsFileExists(const ROMIMG *ROMImg, const char *filename); +extern int CreateBlankROMImg(const char *filename, ROMIMG *ROMImg); +extern int WriteROMImg(const char *file, const ROMIMG *ROMImg); +extern int LoadROMImg(ROMIMG *ROMImg, const char *path); +extern void UnloadROMImg(ROMIMG *ROMImg); +extern int AddFile(ROMIMG *ROMImg, const char *path, int upperconv); +extern int DeleteFile(ROMIMG *ROMImg, const char *filename); +extern int ExtractFile(const ROMIMG *ROMImg, const char *filename, const char *FileToExtract); +extern int IsFileExists(const ROMIMG *ROMImg, const char *filename); #endif /* __ROMING_H__ */