Skip to content

Commit db9bcdb

Browse files
committed
cleanup: use macros for EE sync
1 parent 6556c10 commit db9bcdb

5 files changed

Lines changed: 16 additions & 12 deletions

File tree

ee/debug/src/screenshot.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ int ps2_screenshot( void *pDest, unsigned int VramAdress, unsigned int x,
250250
*PS2SS_D1_MADR = (u32)p_dma32;
251251
*PS2SS_D1_CHCR = 0x101;
252252

253-
__asm__ __volatile__("sync.l\n");
253+
EE_SYNCL();
254254

255255
// check if DMA is complete (STR=0)
256256

@@ -272,13 +272,13 @@ int ps2_screenshot( void *pDest, unsigned int VramAdress, unsigned int x,
272272
*PS2SS_D1_MADR = (u32)pDest;
273273
*PS2SS_D1_CHCR = 0x100;
274274

275-
__asm__ __volatile__(" sync.l\n");
275+
EE_SYNCL();
276276

277277
// check if DMA is complete (STR=0)
278278

279279
while ( *PS2SS_D1_CHCR & 0x0100 );
280280
*PS2SS_D1_CHCR = prev_chcr;
281-
__asm__ __volatile__(" sync.l\n");
281+
EE_SYNCL();
282282
*PS2SS_VIF1_STAT = 0;
283283
*PS2SS_GS_BUSDIR = (u64)0;
284284

ee/dma/src/dma.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,9 @@ void dma_channel_fast_waits(int channel)
115115
void dma_wait_fast(void)
116116
{
117117

118+
EE_SYNCL();
119+
EE_SYNCP();
118120
__asm__ __volatile__ (
119-
"sync.l; sync.p;" \
120121
"0:" \
121122
"bc0t 0f; nop;" \
122123
"bc0t 0f; nop;" \

ee/graph/src/graph_mode.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -141,8 +141,8 @@ int graph_set_mode(int interlace, int mode, int ffmd, int flicker_filter)
141141
GsPutIMR(0x00007700);
142142

143143
// Ensure registers are written prior to setting another mode.
144-
__asm__ __volatile__ ("sync.p\n\t"
145-
"nop\n\t");
144+
EE_SYNCP();
145+
__asm__ __volatile__ ("nop\n\t");
146146

147147
// If 576P is requested, check if bios supports it.
148148
if (mode == GRAPH_MODE_HDTV_576P)
@@ -376,7 +376,8 @@ void graph_set_smode1(char cmod, char gcont)
376376
// Disable PRST for TV modes and enable for all other modes.
377377
*GS_REG_SMODE1 = smode1_val | (u64)1 << 16;
378378

379-
__asm__ __volatile__ ("sync.l; sync.p;");
379+
EE_SYNCL();
380+
EE_SYNCP();
380381

381382
// If VESA, 1080I, or 720P, disable bit PRST now and delay 2.5ms.
382383
if ((graph_crtmode >= 0x1A) && (graph_crtmode != 0x50) && (graph_crtmode != 0x53))
@@ -393,7 +394,8 @@ void graph_set_smode1(char cmod, char gcont)
393394
// Now enable read circuits.
394395
*GS_REG_PMODE = pmode_val;
395396

396-
__asm__ __volatile__ ("sync.l; sync.p;");
397+
EE_SYNCL();
398+
EE_SYNCP();
397399

398400
}
399401

ee/kernel/src/glue.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ int DIntr()
3131
__asm__ (".p2align 3");
3232
do {
3333
__asm__ __volatile__("di");
34-
__asm__ __volatile__("sync.p");
34+
EE_SYNCP();
3535
__asm__ __volatile__("mfc0\t%0, $12"
3636
: "=r"(eie));
3737
eie &= 0x10000;

ee/kernel/src/tlbfunc.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,8 @@ static int InitTLB32MB(void)
149149

150150
kprintf("# TLB spad=0 kernel=1:%d default=%d:%d extended=%d:%d\n", TLBInfo.NumKernelTLBEntries - 1, TLBInfo.NumKernelTLBEntries, TLBInfo.NumKernelTLBEntries + TLBInfo.NumDefaultTLBEntries - 1, TLBInfo.NumKernelTLBEntries + TLBInfo.NumDefaultTLBEntries, TLBInfo.NumKernelTLBEntries + TLBInfo.NumDefaultTLBEntries + TLBInfo.NumExtendedTLBEntries - 1);
151151

152-
__asm__ __volatile__("mtc0 $zero, $6\n"
153-
"sync.p\n");
152+
__asm__ __volatile__("mtc0 $zero, $6\n");
153+
EE_SYNCP();
154154

155155
if (TLBInfo.NumKernelTLBEntries >= 0x31) {
156156
kprintf("# TLB over flow (1)");
@@ -172,7 +172,8 @@ static int InitTLB32MB(void)
172172

173173
TLBInfo.NumWiredEntries = NumTlbEntries = i;
174174
__asm__ __volatile__("mtc0 %0, $6\n"
175-
"sync.p\n" ::"r"(NumTlbEntries));
175+
::"r"(NumTlbEntries));
176+
EE_SYNCP();
176177

177178
if (TLBInfo.NumExtendedTLBEntries > 0) {
178179
if (TLBInfo.NumExtendedTLBEntries + i >= 0x31) {

0 commit comments

Comments
 (0)