mirror of
https://github.com/RaySollium99/picodrive.git
synced 2025-09-05 07:17:45 -04:00
32x: split sh2 code, compiler stub
git-svn-id: file:///home/notaz/opt/svn/PicoDrive@810 be3aeb3a-fb24-0410-a615-afba39da0efa
This commit is contained in:
parent
1d29444dfc
commit
4139770121
16 changed files with 227 additions and 205 deletions
36
cpu/drc/cmn.c
Normal file
36
cpu/drc/cmn.c
Normal file
|
@ -0,0 +1,36 @@
|
|||
#include <stdio.h>
|
||||
#if defined(__linux__) && defined(ARM)
|
||||
#include <sys/mman.h>
|
||||
#endif
|
||||
|
||||
#include "cmn.h"
|
||||
|
||||
#ifndef ARM
|
||||
unsigned int tcache[SSP_TCACHE_SIZE/4];
|
||||
unsigned int *ssp_block_table[0x5090/2];
|
||||
unsigned int *ssp_block_table_iram[15][0x800/2];
|
||||
char ssp_align[SSP_BLOCKTAB_ALIGN_SIZE];
|
||||
#endif
|
||||
|
||||
|
||||
void drc_cmn_init(void)
|
||||
{
|
||||
#if defined(__linux__) && defined(ARM)
|
||||
void *tmp;
|
||||
|
||||
tmp = mmap(tcache, SSP_DRC_SIZE, PROT_READ|PROT_WRITE|PROT_EXEC, MAP_SHARED|MAP_ANONYMOUS, -1, 0);
|
||||
printf("mmap tcache: %p, asked %p\n", tmp, tcache);
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
// TODO: add calls in core, possibly to cart.c?
|
||||
void drc_cmn_cleanup(void)
|
||||
{
|
||||
#if defined(__linux__) && defined(ARM)
|
||||
int ret;
|
||||
ret = munmap(tcache, SSP_DRC_SIZE);
|
||||
printf("munmap tcache: %i\n", ret);
|
||||
#endif
|
||||
}
|
||||
|
13
cpu/drc/cmn.h
Normal file
13
cpu/drc/cmn.h
Normal file
|
@ -0,0 +1,13 @@
|
|||
#define SSP_TCACHE_SIZE (512*1024)
|
||||
#define SSP_BLOCKTAB_SIZE (0x5090/2*4)
|
||||
#define SSP_BLOCKTAB_IRAM_SIZE (15*0x800/2*4)
|
||||
#define SSP_BLOCKTAB_ALIGN_SIZE 3808
|
||||
#define SSP_DRC_SIZE (SSP_TCACHE_SIZE + SSP_BLOCKTAB_SIZE + SSP_BLOCKTAB_IRAM_SIZE + SSP_BLOCKTAB_ALIGN_SIZE)
|
||||
|
||||
extern unsigned int tcache[SSP_TCACHE_SIZE/4];
|
||||
extern unsigned int *ssp_block_table[SSP_BLOCKTAB_SIZE/4];
|
||||
extern unsigned int *ssp_block_table_iram[15][0x800/2];
|
||||
|
||||
void drc_cmn_init(void);
|
||||
void drc_cmn_cleanup(void);
|
||||
|
25
cpu/drc/cmn_arm.S
Normal file
25
cpu/drc/cmn_arm.S
Normal file
|
@ -0,0 +1,25 @@
|
|||
@ vim:filetype=armasm
|
||||
|
||||
.if 0
|
||||
#include "cmn.h"
|
||||
.endif
|
||||
|
||||
.global tcache
|
||||
.global ssp_block_table
|
||||
.global ssp_block_table_iram
|
||||
|
||||
@ translation cache buffer + pointer table
|
||||
.data
|
||||
.align 12 @ 4096
|
||||
@.size tcache, SSP_TCACHE_SIZE
|
||||
@.size ssp_block_table, SSP_BLOCKTAB_SIZE
|
||||
@.size ssp_block_table_iram, SSP_BLOCKTAB_IRAM_SIZE
|
||||
tcache:
|
||||
.space SSP_TCACHE_SIZE
|
||||
ssp_block_table:
|
||||
.space SSP_BLOCKTAB_SIZE
|
||||
ssp_block_table_iram:
|
||||
.space SSP_BLOCKTAB_IRAM_SIZE
|
||||
.space SSP_BLOCKTAB_ALIGN_SIZE
|
||||
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue