1 # Copyright (C) 2016-2023 Free Software Foundation, Inc.
2 # Contributed by Dimitar Dimitrov <dimitar@dinux.eu>
4 # This file is part of the GNU simulators.
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 3 of the License, or
9 # (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program. If not, see <http://www.gnu.org/licenses/>.
20 # All assembler tests should start with a call to "main_test"
27 # Skip over these inlined funcs.
31 .type __pass, function
33 # Note - DRAM LMA and VMA are equal for PRU, so
34 # we can afford to pass DRAM pointer directly.
39 .type __fail, function
53 .type __main_test, function
58 # Make a libgloss system call
59 .macro system_call nr:req, arg1=0, arg2=0, arg3=0
68 # Quit the current test
74 # Write 'pass' to stdout via syscalls and quit;
75 # meant for non-OS operating environments
81 # Write 'fail' to stdout via syscalls and quit;
82 # meant for non-OS operating environments
88 # Just like the write() C function; uses system calls
89 .macro write fd:req, str:req, len:req
90 system_call 5, \fd, \str, \len
94 # Like qbne instruction, but check a 32-bit constant value.
95 .macro qbne32 label:req, op0:req, C0:req
96 qbne \label, \op0\().b0, ((\C0) >> 0) & 0xff
97 qbne \label, \op0\().b1, ((\C0) >> 8) & 0xff
98 qbne \label, \op0\().b2, ((\C0) >> 16) & 0xff
99 qbne \label, \op0\().b3, ((\C0) >> 24) & 0xff