OpenCores
URL https://opencores.org/ocsvn/potato/potato/trunk

Subversion Repositories potato

[/] [potato/] [trunk/] [riscv-tests/] [scall.S] - Blame information for rev 60

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 51 skordal
# See LICENSE for license details.
2
 
3
#*****************************************************************************
4
# scall.S
5
#-----------------------------------------------------------------------------
6
#
7
# Test syscall trap.
8
#
9
 
10
#include "riscv_test.h"
11
#include "test_macros.h"
12
 
13
RVTEST_RV32M
14
RVTEST_CODE_BEGIN
15
 
16
#define sscratch mscratch
17
#define sstatus mstatus
18
#define scause mcause
19
#define sepc mepc
20
#define stvec_handler mtvec_handler
21
 
22
#undef CAUSE_SUPERVISOR_ECALL
23
#define CAUSE_SUPERVISOR_ECALL CAUSE_MACHINE_ECALL
24
 
25
  li TESTNUM, 2
26
  scall
27
  j fail
28
 
29
  j pass
30
 
31
  TEST_PASSFAIL
32
 
33
stvec_handler:
34
  li t1, CAUSE_SUPERVISOR_ECALL
35
  csrr t0, scause
36
  bne t0, t1, fail
37
  csrr t0, sepc
38
  addi t0, t0, 8
39
  csrw sepc, t0
40
  sret
41
 
42
RVTEST_CODE_END
43
 
44
  .data
45
RVTEST_DATA_BEGIN
46
 
47
  TEST_DATA
48
 
49
RVTEST_DATA_END

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.