source: mainline/uspace/lib/c/arch/mips32/src/fibril.S@ a35b458

lfn serial ticket/834-toolchain-update topic/msim-upgrade topic/simplify-dev-export
Last change on this file since a35b458 was a35b458, checked in by Jiří Zárevúcky <zarevucky.jiri@…>, 8 years ago

style: Remove trailing whitespace on _all_ lines, including empty ones, for particular file types.

Command used: tools/srepl '\s\+$' '' -- *.c *.h *.py *.sh *.s *.S *.ag

Currently, whitespace on empty lines is very inconsistent.
There are two basic choices: Either remove the whitespace, or keep empty lines
indented to the level of surrounding code. The former is AFAICT more common,
and also much easier to do automatically.

Alternatively, we could write script for automatic indentation, and use that
instead. However, if such a script exists, it's possible to use the indented
style locally, by having the editor apply relevant conversions on load/save,
without affecting remote repository. IMO, it makes more sense to adopt
the simpler rule.

  • Property mode set to 100644
File size: 3.8 KB
RevLine 
[29a9f62]1#
[df4ed85]2# Copyright (c) 2003-2004 Jakub Jermar
[29a9f62]3# All rights reserved.
4#
5# Redistribution and use in source and binary forms, with or without
6# modification, are permitted provided that the following conditions
7# are met:
8#
9# - Redistributions of source code must retain the above copyright
10# notice, this list of conditions and the following disclaimer.
11# - Redistributions in binary form must reproduce the above copyright
12# notice, this list of conditions and the following disclaimer in the
13# documentation and/or other materials provided with the distribution.
14# - The name of the author may not be used to endorse or promote products
15# derived from this software without specific prior written permission.
16#
17# THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
18# IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
19# OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
20# IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
21# INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
22# NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
23# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
26# THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27#
28
29.text
30
31.set noat
32.set noreorder
33
[0407636]34#include <abi/asmtool.h>
[4b334fd6]35#include <libarch/fibril_context.h>
[8df9290]36
[0407636]37FUNCTION_BEGIN(context_save)
[4b334fd6]38 sw $s0, CONTEXT_OFFSET_S0($a0)
39 sw $s1, CONTEXT_OFFSET_S1($a0)
40 sw $s2, CONTEXT_OFFSET_S2($a0)
41 sw $s3, CONTEXT_OFFSET_S3($a0)
42 sw $s4, CONTEXT_OFFSET_S4($a0)
43 sw $s5, CONTEXT_OFFSET_S5($a0)
44 sw $s6, CONTEXT_OFFSET_S6($a0)
45 sw $s7, CONTEXT_OFFSET_S7($a0)
46 sw $s8, CONTEXT_OFFSET_S8($a0)
47 sw $gp, CONTEXT_OFFSET_GP($a0)
[a35b458]48
[4b334fd6]49 sw $k1, CONTEXT_OFFSET_TLS($a0)
[a35b458]50
[4b334fd6]51#ifdef CONFIG_FPU
52 mfc1 $t0, $20
53 sw $t0, CONTEXT_OFFSET_F20($a0)
[a35b458]54
[4b334fd6]55 mfc1 $t0, $21
56 sw $t0, CONTEXT_OFFSET_F21($a0)
[a35b458]57
[4b334fd6]58 mfc1 $t0, $22
59 sw $t0, CONTEXT_OFFSET_F22($a0)
[a35b458]60
[4b334fd6]61 mfc1 $t0, $23
62 sw $t0, CONTEXT_OFFSET_F23($a0)
[a35b458]63
[4b334fd6]64 mfc1 $t0, $24
65 sw $t0, CONTEXT_OFFSET_F24($a0)
[a35b458]66
[4b334fd6]67 mfc1 $t0, $25
68 sw $t0, CONTEXT_OFFSET_F25($a0)
[a35b458]69
[4b334fd6]70 mfc1 $t0, $26
71 sw $t0, CONTEXT_OFFSET_F26($a0)
[a35b458]72
[4b334fd6]73 mfc1 $t0, $27
74 sw $t0, CONTEXT_OFFSET_F27($a0)
[a35b458]75
[4b334fd6]76 mfc1 $t0, $28
77 sw $t0, CONTEXT_OFFSET_F28($a0)
[a35b458]78
[4b334fd6]79 mfc1 $t0, $29
80 sw $t0, CONTEXT_OFFSET_F29($a0)
[a35b458]81
[4b334fd6]82 mfc1 $t0, $30
83 sw $t0, CONTEXT_OFFSET_F30($a0)
84#endif /* CONFIG_FPU */
[a35b458]85
[4b334fd6]86 sw $ra, CONTEXT_OFFSET_PC($a0)
87 sw $sp, CONTEXT_OFFSET_SP($a0)
[a35b458]88
[29a9f62]89 # context_save returns 1
90 j $ra
[8df9290]91 li $v0, 1
[0407636]92FUNCTION_END(context_save)
[8df9290]93
[0407636]94FUNCTION_BEGIN(context_restore)
[4b334fd6]95 lw $s0, CONTEXT_OFFSET_S0($a0)
96 lw $s1, CONTEXT_OFFSET_S1($a0)
97 lw $s2, CONTEXT_OFFSET_S2($a0)
98 lw $s3, CONTEXT_OFFSET_S3($a0)
99 lw $s4, CONTEXT_OFFSET_S4($a0)
100 lw $s5, CONTEXT_OFFSET_S5($a0)
101 lw $s6, CONTEXT_OFFSET_S6($a0)
102 lw $s7, CONTEXT_OFFSET_S7($a0)
103 lw $s8, CONTEXT_OFFSET_S8($a0)
104 lw $gp, CONTEXT_OFFSET_GP($a0)
105 lw $k1, CONTEXT_OFFSET_TLS($a0)
[a35b458]106
[4b334fd6]107#ifdef CONFIG_FPU
108 lw $t0, CONTEXT_OFFSET_F20($a0)
109 mtc1 $t0, $20
[a35b458]110
[4b334fd6]111 lw $t0, CONTEXT_OFFSET_F21($a0)
112 mtc1 $t0, $21
[a35b458]113
[4b334fd6]114 lw $t0, CONTEXT_OFFSET_F22($a0)
115 mtc1 $t0, $22
[a35b458]116
[4b334fd6]117 lw $t0, CONTEXT_OFFSET_F23($a0)
118 mtc1 $t0, $23
[a35b458]119
[4b334fd6]120 lw $t0, CONTEXT_OFFSET_F24($a0)
121 mtc1 $t0, $24
[a35b458]122
[4b334fd6]123 lw $t0, CONTEXT_OFFSET_F25($a0)
124 mtc1 $t0, $25
[a35b458]125
[4b334fd6]126 lw $t0, CONTEXT_OFFSET_F26($a0)
127 mtc1 $t0, $26
[a35b458]128
[4b334fd6]129 lw $t0, CONTEXT_OFFSET_F27($a0)
130 mtc1 $t0, $27
[a35b458]131
[4b334fd6]132 lw $t0, CONTEXT_OFFSET_F28($a0)
133 mtc1 $t0, $28
[a35b458]134
[4b334fd6]135 lw $t0, CONTEXT_OFFSET_F29($a0)
136 mtc1 $t0, $29
[a35b458]137
[4b334fd6]138 lw $t0, CONTEXT_OFFSET_F30($a0)
139 mtc1 $t0, $30
140#endif /* CONFIG_FPU */
[a35b458]141
[4b334fd6]142 lw $ra, CONTEXT_OFFSET_PC($a0)
143 lw $sp, CONTEXT_OFFSET_SP($a0)
[a35b458]144
[df366b5e]145 # Just for the jump into first function,
146 # but one instruction should not bother us
[8df9290]147 move $t9, $ra
[a35b458]148
[29a9f62]149 # context_restore returns 0
150 j $ra
[8df9290]151 xor $v0, $v0
[0407636]152FUNCTION_END(context_restore)
Note: See TracBrowser for help on using the repository browser.