Nugget
|
#include "common/hardware/dma.h"
#include "common/hardware/hwregs.h"
#include "common/syscalls/syscalls.h"
#include "exotic/cester.h"
#include "cester-cop0.c"
Macros | |
#define | PCSX_TESTS 0 |
#define | CESTER_MAYBE_TEST CESTER_TEST |
#define | CESTER_NO_SIGNAL |
#define | CESTER_NO_TIME |
#define | EXIT_SUCCESS 0 |
#define | EXIT_FAILURE 1 |
Functions | |
CESTER_TEST (cpu_cop0_basic_write_bp, cpu_tests, uint32_t expectedEPC;uint32_t t;volatile uint32_t *ptr=(volatile uint32_t *) 0x58; *ptr=1;__asm__ volatile("" " lui %0, 0b1100101010000000\n" " mtc0 %0, $7\n" " li %0, 0x58\n" " mtc0 %0, $5\n" " li %0, 0xfffffff0\n" " mtc0 %0, $9\n" :"=r"(t));cester_assert_uint_eq(1, *ptr);__asm__ volatile("la %0, 1f\n1:\nsw $0, 0x58($0)" :"=r"(expectedEPC));__asm__ volatile("mtc0 $0, $7\n");cester_assert_uint_eq(0, *ptr);cester_assert_uint_eq(1, s_got40);cester_assert_uint_eq(0, s_got80);cester_assert_uint_eq(0x40, s_from);cester_assert_uint_eq(expectedEPC, s_epc);) CESTER_TEST(cpu_cop0_kseg_write_bp | |
__asm__ | volatile ("" " lui %0, 0b1100101010000000\n" " mtc0 %0, $7\n" " li %0, 0x58\n" " mtc0 %0, $5\n" " li %0, 0xfffffff0\n" " mtc0 %0, $9\n" :"=r"(t)) |
cester_assert_uint_eq (1, *ptr) | |
__asm__ | volatile ("lui $at, 0x8000\nsw $0, 0x58($at)") |
__asm__ | volatile ("mtc0 $0, $7\n") |
cester_assert_uint_eq (0, *ptr) | |
cester_assert_uint_eq (0, s_got40) | |
cester_assert_uint_eq (0, s_got80) | |
cester_assert_uint_eq (0, s_from) | |
cester_assert_uint_eq (0, s_epc) | |
CESTER_TEST (cpu_cop0_upper_memory_write_bp, cpu_tests, uint32_t t;volatile uint32_t *ptr=(volatile uint32_t *) 0x00200058; *ptr=1;__asm__ volatile("" " lui %0, 0b1100101010000000\n" " mtc0 %0, $7\n" " li %0, 0x58\n" " mtc0 %0, $5\n" " li %0, 0xfffffff0\n" " mtc0 %0, $9\n" :"=r"(t));cester_assert_uint_eq(1, *ptr);__asm__ volatile("lui $at, 0x0020\nsw $0, 0x58($at)");__asm__ volatile("mtc0 $0, $7\n");cester_assert_uint_eq(0, *ptr);cester_assert_uint_eq(0, s_got40);cester_assert_uint_eq(0, s_got80);cester_assert_uint_eq(0, s_from);cester_assert_uint_eq(0, s_epc);) CESTER_TEST(cpu_cop0_unaligned_write_bp | |
cester_assert_uint_eq (0x01020304, *ptr) | |
__asm__ | volatile ("la %0, 1f\n1:\nsb $0, 0x59($0)" :"=r"(expectedEPC)) |
cester_assert_uint_eq (0x01020004, *ptr) | |
cester_assert_uint_eq (1, s_got40) | |
cester_assert_uint_eq (0x40, s_from) | |
cester_assert_uint_eq (expectedEPC, s_epc) | |
Variables | |
cpu_tests | |
uint32_t | t |
volatile uint32_t * | ptr = (volatile uint32_t *) 0x80000058 |
uint32_t | expectedEPC |
#define CESTER_MAYBE_TEST CESTER_TEST |
#define CESTER_NO_SIGNAL |
#define CESTER_NO_TIME |
#define EXIT_FAILURE 1 |
#define EXIT_SUCCESS 0 |
#define PCSX_TESTS 0 |
cester_assert_uint_eq | ( | 0 | , |
* | ptr | ||
) |
cester_assert_uint_eq | ( | 0 | , |
s_epc | |||
) |
cester_assert_uint_eq | ( | 0 | , |
s_from | |||
) |
cester_assert_uint_eq | ( | 0 | , |
s_got40 | |||
) |
cester_assert_uint_eq | ( | 0 | , |
s_got80 | |||
) |
cester_assert_uint_eq | ( | 0x01020004 | , |
* | ptr | ||
) |
cester_assert_uint_eq | ( | 0x01020304 | , |
* | ptr | ||
) |
cester_assert_uint_eq | ( | 0x40 | , |
s_from | |||
) |
cester_assert_uint_eq | ( | 1 | , |
* | ptr | ||
) |
cester_assert_uint_eq | ( | 1 | , |
s_got40 | |||
) |
cester_assert_uint_eq | ( | expectedEPC | , |
s_epc | |||
) |
CESTER_TEST | ( | cpu_cop0_basic_write_bp | , |
cpu_tests | , | ||
uint32_t expectedEPC;uint32_t t;volatile uint32_t * | ptr = (volatile uint32_t *) 0x58; *ptr = 1; __asm__ volatile(""" lui %0, 0b1100101010000000\n"" mtc0 %0, $7\n"" li %0, 0x58\n"" mtc0 %0, $5\n"" li %0, 0xfffffff0\n"" mtc0 %0, $9\n" : "=r"(t)); cester_assert_uint_eq(1, *ptr); __asm__ volatile("la %0, 1f\n1:\nsw $0, 0x58($0)" : "=r"(expectedEPC)); __asm__ volatile("mtc0 $0, $7\n"); cester_assert_uint_eq(0, *ptr); cester_assert_uint_eq(1, s_got40); cester_assert_uint_eq(0, s_got80); cester_assert_uint_eq(0x40, s_from); cester_assert_uint_eq(expectedEPC, s_epc); |
||
) |
CESTER_TEST | ( | cpu_cop0_upper_memory_write_bp | , |
cpu_tests | , | ||
uint32_t t;volatile uint32_t * | ptr = (volatile uint32_t *) 0x00200058; *ptr = 1; __asm__ volatile(""" lui %0, 0b1100101010000000\n"" mtc0 %0, $7\n"" li %0, 0x58\n"" mtc0 %0, $5\n"" li %0, 0xfffffff0\n"" mtc0 %0, $9\n" : "=r"(t)); cester_assert_uint_eq(1, *ptr); __asm__ volatile("lui $at, 0x0020\nsw $0, 0x58($at)"); __asm__ volatile("mtc0 $0, $7\n"); cester_assert_uint_eq(0, *ptr); cester_assert_uint_eq(0, s_got40); cester_assert_uint_eq(0, s_got80); cester_assert_uint_eq(0, s_from); cester_assert_uint_eq(0, s_epc); |
||
) |
__asm__ volatile | ( | "" " lui % | 0, |
0b1100101010000000\n" " mtc0 % | 0, | ||
$7\n" " li %, | |||
0x58\n" " mtc0 % | 0, | ||
$5\n" " li %, | |||
0xfffffff0\n" " mtc0 % | 0 | ||
) |
__asm__ volatile | ( | "la % | 0, |
1f\n1:\nsb | $0 | ||
) |
__asm__ volatile | ( | "lui | $at, |
0x8000\nsw | $0, | ||
0x58($at)" | |||
) |
__asm__ volatile | ( | "mtc0 | $0, |
$7\n" | |||
) |
cpu_tests |
uint32_t expectedEPC |
uint32_t t |