mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-15 19:28:43 +12:00
- Implemented RAW SPU.
- Implemented memory mapping.
This commit is contained in:
parent
027a31bd84
commit
559852a8fc
43 changed files with 1106 additions and 224 deletions
|
@ -133,18 +133,18 @@ bool ELF32Loader::LoadPhdrData(u64 offset)
|
|||
{
|
||||
phdr_arr[i].Show();
|
||||
|
||||
if(phdr_arr[i].p_vaddr < min_addr)
|
||||
{
|
||||
min_addr = phdr_arr[i].p_vaddr;
|
||||
}
|
||||
|
||||
if(phdr_arr[i].p_vaddr + phdr_arr[i].p_memsz > max_addr)
|
||||
{
|
||||
max_addr = phdr_arr[i].p_vaddr + phdr_arr[i].p_memsz;
|
||||
}
|
||||
|
||||
if(phdr_arr[i].p_type == 0x00000001) //LOAD
|
||||
{
|
||||
if(phdr_arr[i].p_vaddr < min_addr)
|
||||
{
|
||||
min_addr = phdr_arr[i].p_vaddr;
|
||||
}
|
||||
|
||||
if(phdr_arr[i].p_vaddr + phdr_arr[i].p_memsz > max_addr)
|
||||
{
|
||||
max_addr = phdr_arr[i].p_vaddr + phdr_arr[i].p_memsz;
|
||||
}
|
||||
|
||||
if(phdr_arr[i].p_vaddr != phdr_arr[i].p_paddr)
|
||||
{
|
||||
ConLog.Warning
|
||||
|
@ -158,6 +158,40 @@ bool ELF32Loader::LoadPhdrData(u64 offset)
|
|||
elf32_f.Seek(phdr_arr[i].p_offset);
|
||||
elf32_f.Read(&Memory[phdr_arr[i].p_vaddr + offset], phdr_arr[i].p_filesz);
|
||||
}
|
||||
else if(phdr_arr[i].p_type == 0x00000004)
|
||||
{
|
||||
elf32_f.Seek(phdr_arr[i].p_offset);
|
||||
Elf32_Note note;
|
||||
note.Load(elf32_f);
|
||||
|
||||
if(note.type != 1)
|
||||
{
|
||||
ConLog.Error("ELF32: Bad NOTE type (%d)", note.type);
|
||||
break;
|
||||
}
|
||||
|
||||
if(note.namesz != sizeof(note.name))
|
||||
{
|
||||
ConLog.Error("ELF32: Bad NOTE namesz (%d)", note.namesz);
|
||||
break;
|
||||
}
|
||||
|
||||
if(note.descsz < sizeof(note.desc))
|
||||
{
|
||||
ConLog.Error("ELF32: Bad NOTE descsz (%d)", note.descsz);
|
||||
break;
|
||||
}
|
||||
|
||||
//if(note.desc.flags)
|
||||
//{
|
||||
// ConLog.Error("ELF32: Bad NOTE flags (0x%x)", note.desc.flags);
|
||||
// break;
|
||||
//}
|
||||
|
||||
ConLog.Warning("name = %s", note.name);
|
||||
ConLog.Warning("ls_size = %d", note.desc.ls_size);
|
||||
ConLog.Warning("stack_size = %d", note.desc.stack_size);
|
||||
}
|
||||
#ifdef LOADER_DEBUG
|
||||
ConLog.SkipLn();
|
||||
#endif
|
||||
|
@ -177,6 +211,11 @@ bool ELF32Loader::LoadShdrData(u64 offset)
|
|||
shdr.Show();
|
||||
ConLog.SkipLn();
|
||||
#endif
|
||||
if((shdr.sh_type == SHT_RELA) || (shdr.sh_type == SHT_REL))
|
||||
{
|
||||
ConLog.Error("ELF32 ERROR: Relocation");
|
||||
continue;
|
||||
}
|
||||
if((shdr.sh_flags & SHF_ALLOC) != SHF_ALLOC) continue;
|
||||
|
||||
if(shdr.sh_addr < min_addr)
|
||||
|
@ -188,21 +227,6 @@ bool ELF32Loader::LoadShdrData(u64 offset)
|
|||
{
|
||||
max_addr = shdr.sh_addr + shdr.sh_size;
|
||||
}
|
||||
|
||||
//const s64 addr = shdr.sh_addr;
|
||||
//const s64 size = shdr.sh_size;
|
||||
//MemoryBlock* mem = nullptr;
|
||||
|
||||
/*
|
||||
switch(shdr.sh_type)
|
||||
{
|
||||
case SHT_NOBITS:
|
||||
if(size == 0) continue;
|
||||
memset(&Memory[addr + offset], 0, size);
|
||||
case SHT_PROGBITS:
|
||||
break;
|
||||
}
|
||||
*/
|
||||
}
|
||||
|
||||
//TODO
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue