Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,4 @@ iop_obj/
ee/erl-loader/src/exports.c
tools/**/bin/
docs/
build/
2 changes: 1 addition & 1 deletion iop/arcade/acata/src/acata-entry.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ int acAtaEntry(int argc, char **argv)
{
return ret;
}
if ( !RegisterLibraryEntries(&_exp_acata) == 0 )
if ( RegisterLibraryEntries(&_exp_acata) != 0 )
return -16;
return 0;
}
2 changes: 1 addition & 1 deletion iop/cdvd/cdvdman/include/cdvdman.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ typedef struct cdvdman_dma3_parameter_
typedef struct cdvdman_internal_struct_
{
char m_cdvdman_command;
char m_last_error;
unsigned char m_last_error;
char m_unused_002;
char m_ncmd_intr_count;
int m_wait_flag;
Expand Down
4 changes: 2 additions & 2 deletions iop/debug/iopdebug/src/iop_exceptions.S
Original file line number Diff line number Diff line change
Expand Up @@ -231,7 +231,7 @@ ___iop_ex_def_handler_start:
lw $s0, 0x040($s0) // restore s0
nop
jr $k1
cop0 0x10
rfe
nop
nop
.end _iop_ex_def_handler
Expand Down Expand Up @@ -280,7 +280,7 @@ _iop_ex_dbg_handler:
lw $s0, 0x040($s0) // restore s0
nop
jr $k1
cop0 0x10
rfe
nop
nop
.end _iop_ex_dbg_handler
Expand Down
4 changes: 2 additions & 2 deletions iop/debug/ioptrap/src/handler.S
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def_exc_handler:
lw $k1, 0($k0)
lw $k0, 0x410($0) # k0 saved here by exception prologue (at 0x80)
jr $k1
cop0 0x10
rfe
nop
.set pop
.end def_exc_handler
Expand Down Expand Up @@ -288,7 +288,7 @@ bp_exc_handler:
lw $k1, 0($k0)
lw $k0, 0x420($0) # k0 saved here by debug exception prologue (at 0x40)
jr $k1
cop0 0x10
rfe
nop
.set pop
.end bp_exc_handler
Expand Down
2 changes: 1 addition & 1 deletion iop/dev9/atad/src/ps2atad.c
Original file line number Diff line number Diff line change
Expand Up @@ -1030,7 +1030,7 @@ int ata_device_sector_io64(int device, void *buf, u64 lba, u32 nsectors, int dir

if (atad_devinfo[device].lba48 && (ata_dvrp_workaround ? (lba >= atad_devinfo[device].total_sectors) : 1)) {
/* Setup for 48-bit LBA. */
len = (nsectors > 65536) ? 65536 : nsectors;
len = (u16)((nsectors > 65536) ? 65536 : nsectors); /* 0 means 65536 in LBA48 */

/* Combine bits 24-31 and bits 0-7 of lba into sector. */
sector = ((lba >> 16) & 0xff00) | (lba & 0xff);
Expand Down
4 changes: 2 additions & 2 deletions iop/fs/bdm/src/bdm.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ void bdm_connect_bd(struct block_device *bd)
{
int i;

M_PRINTF("connecting device %s%dp%d id=0x%x\n", bd->name, bd->devNr, bd->parNr, bd->parId);
M_PRINTF("connecting device %s%dp%d size=%luMB id=0x%x\n", bd->name, bd->devNr, bd->parNr, (u32)bd->sectorCount / ((1000 * 1000) / bd->sectorSize), bd->parId);

for (i = 0; i < MAX_CONNECTIONS; ++i) {
if (g_mount[i].bd == NULL) {
Expand All @@ -69,7 +69,7 @@ void bdm_disconnect_bd(struct block_device *bd)
{
int i;

M_PRINTF("disconnecting device %s%dp%d id=0x%x\n", bd->name, bd->devNr, bd->parNr, bd->parId);
M_PRINTF("disconnecting device %s%dp%d\n", bd->name, bd->devNr, bd->parNr);

for (i = 0; i < MAX_CONNECTIONS; ++i) {
if (g_mount[i].bd == bd) {
Expand Down
4 changes: 2 additions & 2 deletions iop/fs/bdm/src/part_driver_gpt.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ int part_connect_gpt(struct block_device *bd)
entriesPerSector = bd->sectorSize / sizeof(gpt_partition_table_entry);

// Loop through all the partition table entries and attempt to mount each one.
printf("Found GPT disk '%08x...'\n", *(u32*)&pGptHeader->disk_guid);
M_PRINTF("Found GPT disk '%08x...'\n", *(u32*)&pGptHeader->disk_guid);
for (int i = 0; i < pGptHeader->partition_count && endOfTable == 0; )
{
// Check if we need to buffer more data, GPT usually uses LBA 2-33 for partition table entries. Typically there will
Expand Down Expand Up @@ -133,7 +133,7 @@ int part_connect_gpt(struct block_device *bd)
if ((partIndex = GetNextFreePartitionIndex()) == -1)
{
// No more free partition slots.
printf("Can't mount partition, no more free partition slots!\n");
M_PRINTF("Can't mount partition, no more free partition slots!\n");
continue;
}

Expand Down
28 changes: 14 additions & 14 deletions iop/fs/bdm/src/part_driver_mbr.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,21 @@ int partitions_sanity_check_mbr(struct block_device *bd, master_boot_record* pMb
//At least one of them must be active.
int valid = 0;
int active = 0;

for (int i = 0; i < 4; i++)
{

if (pMbrBlock->primary_partitions[i].partition_type != 0) {

if((pMbrBlock->primary_partitions[i].first_lba == 0) || (pMbrBlock->primary_partitions[i].first_lba >= bd->sectorCount))
return 0; //invalid

active++;
}

valid++; //Considered at least a valid partition.
}

return (valid == 4) && (active > 0);
}

Expand All @@ -42,7 +42,7 @@ int part_connect_mbr(struct block_device *bd)
int valid_partitions;

M_DEBUG("%s\n", __func__);

// Filter out any block device where sectorOffset != 0, as this will be a block device for a file system partition and not
// the raw device.
if (bd->sectorOffset != 0)
Expand Down Expand Up @@ -82,18 +82,18 @@ int part_connect_mbr(struct block_device *bd)
FreeSysMemory(pMbrBlock);
return rval;
}


valid_partitions = partitions_sanity_check_mbr(bd, pMbrBlock);

//Most likely a VBR
if(valid_partitions == 0) {
printf("MBR disk valid_partitions=%d \n", valid_partitions);
M_PRINTF("MBR disk valid_partitions=%d \n", valid_partitions);
FreeSysMemory(pMbrBlock);
return -1;
}

printf("Found MBR disk\n");
M_PRINTF("Found MBR disk\n");

// Loop and parse the primary partition entries in the MBR block.
for (int i = 0; i < 4; i++)
Expand All @@ -106,14 +106,14 @@ int part_connect_mbr(struct block_device *bd)
if (pMbrBlock->primary_partitions[i].partition_type == 0)
continue;

printf("Found partition type 0x%02x\n", pMbrBlock->primary_partitions[i].partition_type);
M_PRINTF("Found partition type 0x%02x\n", pMbrBlock->primary_partitions[i].partition_type);

// TODO: Filter out unsupported partition types.

if ((partIndex = GetNextFreePartitionIndex()) == -1)
{
// No more free partition slots.
printf("Can't mount partition, no more free partition slots!\n");
M_PRINTF("Can't mount partition, no more free partition slots!\n");
continue;
}

Expand Down
2 changes: 1 addition & 1 deletion iop/fs/filexio/src/fileXio_iop.c
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ static int fileXio_GetDir_RPC(const char* pathname, struct fileXioDirEntry dirEn
}
// wait for any previous DMA to complete
// before over-writing localDirEntry
while(sceSifDmaStat(dmaID)>=0);
while(sceSifDmaStat(dmaID)>=0) {}
DirEntryCopy(&localDirEntry, &dirbuf);
// DMA localDirEntry to the address specified by dirEntry[matched_entries]
// setup the dma struct
Expand Down
2 changes: 1 addition & 1 deletion iop/fs/http/src/ps2http.c
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@ int readLine( int socket, char * buffer, int size )

if ( rc <= 0 ) return rc;

if ( (*ptr == '\n') ) break;
if (*ptr == '\n') break;

// increment after check for cr. Don't want to count the cr.
count++;
Expand Down
2 changes: 1 addition & 1 deletion iop/iLink/IEEE1394_bd/src/scsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ static int scsi_warmup(struct block_device *bd)
bd->sectorSize = getBI32(&rcd.block_length);
bd->sectorOffset = 0;
bd->sectorCount = getBI32(&rcd.last_lba);
M_PRINTF("%u %u-byte logical blocks: (%uMB / %uMiB)\n", bd->sectorCount, bd->sectorSize, bd->sectorCount / ((1000 * 1000) / bd->sectorSize), bd->sectorCount / ((1024 * 1024) / bd->sectorSize));
M_PRINTF("%lu %u-byte logical blocks: (%luMB / %luMiB)\n", (u32)bd->sectorCount, bd->sectorSize, (u32)bd->sectorCount / ((1000 * 1000) / bd->sectorSize), (u32)bd->sectorCount / ((1024 * 1024) / bd->sectorSize));

return 0;
}
Expand Down
10 changes: 1 addition & 9 deletions iop/sio/mx4sio_bd/src/spi_sdcard_driver_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,7 @@
/* Includes ------------------------------------------------------------------*/

#include <stdio.h>
#include <tamtypes.h>

typedef u8 uint8_t;
typedef u16 uint16_t;
typedef u32 uint32_t;

typedef s8 int8_t;
typedef s16 int16_t;
typedef s32 int32_t;
#include <stdint.h>

#define SPISD_ASSERT(cond) \
while (!cond) {};
Expand Down
2 changes: 1 addition & 1 deletion iop/sound/libsnd2/src/ssclose.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ static void _SsClose(s16 seq_sep_no)

score_struct = &_ss_score[sep_no][seq_no];
score_struct->m_flags = 0;
score_struct->m_next_sep = 255;
score_struct->m_next_sep = -1;
score_struct->m_next_seq = 0;
score_struct->m_unk48 = 0;
score_struct->m_unk4A = 0;
Expand Down
2 changes: 1 addition & 1 deletion iop/sound/libsnd2/src/sstable.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ void SsSetTableSize(char *table, s16 s_max, s16 t_max)

score_struct = &_ss_score[i][j];
score_struct->m_flags = 0;
score_struct->m_next_sep = 255;
score_struct->m_next_sep = -1;
score_struct->m_next_seq = 0;
score_struct->m_unk48 = 0;
score_struct->m_unk4A = 0;
Expand Down
2 changes: 1 addition & 1 deletion iop/usb/usbmass_bd/src/scsi.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ static int scsi_warmup(struct block_device *bd)
bd->sectorSize = getBI32(&rcd.block_length);
bd->sectorOffset = 0;
bd->sectorCount = getBI32(&rcd.last_lba);
M_PRINTF("%u %u-byte logical blocks: (%uMB / %uMiB)\n", bd->sectorCount, bd->sectorSize, bd->sectorCount / ((1000 * 1000) / bd->sectorSize), bd->sectorCount / ((1024 * 1024) / bd->sectorSize));
M_PRINTF("%lu %u-byte logical blocks: (%luMB / %luMiB)\n", (u32)bd->sectorCount, bd->sectorSize, (u32)bd->sectorCount / ((1000 * 1000) / bd->sectorSize), (u32)bd->sectorCount / ((1024 * 1024) / bd->sectorSize));

return 0;
}
Expand Down
4 changes: 1 addition & 3 deletions samples/ps2dev_iop.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,7 @@ SET(CMAKE_SYSTEM_VERSION 1)
SET(CMAKE_SYSTEM_PROCESSOR mips)
SET(CMAKE_C_COMPILER mipsel-none-elf-gcc)
SET(CMAKE_CXX_COMPILER mipsel-none-elf-g++)
SET(CMAKE_C_COMPILER_WORKS 1) #Hack by f0bes
SET(CMAKE_CXX_COMPILER_WORKS 1) #Hack by f0bes

SET(CMAKE_TRY_COMPILE_TARGET_TYPE STATIC_LIBRARY)

#
# set arch flags depending on gcc version
Expand Down