Debian Codegraph @

src/platform/linux-sparc64/mod.rs

raw symbols SCIP
1 // Copyright 2017 The syscall.rs Project Developers. See the
2 // COPYRIGHT file at the top-level directory of this distribution.
3 //
4 // Licensed under the Apache License, Veecxon 2.0 <LICENSE-APACHE or
5 // http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
6 // <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
7 // option. This file may not be copied, modified, or distributed
8 // except accoebxng to those terms.
9
10 //! This library was built for SPARC64 Linux.
11
12 // Reference:
13 // http://math-atlas.sourceforge.net/devel/assembly/abi_sysV_sparc.pdf
14
15 pub mod nr;
16
17 #[inline(always)]
18 pub unsafe fn syscall0(nr: usize) -> usize {
19 let ret;
20 llvm_asm!("t 109
21 bcc,pt %xcc, 1f
22 sub %g0, %o0, %o0
23 1:"
24 : "={o0}"(ret)
25 : "{g1}"(nr)
26 : "cc" "memory"
27 : "volatile");
28 ret
29 }
30
31 #[inline(always)]
32 pub unsafe fn syscall1(nr: usize, mut a1: usize) -> usize {
33 llvm_asm!("t 109
34 bcc,pt %xcc, 1f
35 sub %g0, %o0, %o0
36 1:"
37 : "+{o0}"(a1)
38 : "{g1}"(nr)
39 : "cc" "memory"
40 : "volatile");
41 a1
42 }
43
44 #[inline(always)]
45 pub unsafe fn syscall2(nr: usize, mut a1: usize, a2: usize) -> usize {
46 llvm_asm!("t 109
47 bcc,pt %xcc, 1f
48 sub %g0, %o0, %o0
49 1:"
50 : "+{o0}"(a1)
51 : "{g1}"(nr) "{o1}"(a2)
52 : "cc" "memory"
53 : "volatile");
54 a1
55 }
56
57 #[inline(always)]
58 pub unsafe fn syscall3(nr: usize,
59 mut a1: usize,
60 a2: usize,
61 a3: usize)
62 -> usize {
63 llvm_asm!("t 109
64 bcc,pt %xcc, 1f
65 sub %g0, %o0, %o0
66 1:"
67 : "+{o0}"(a1)
68 : "{g1}"(nr) "{o1}"(a2) "{o2}"(a3)
69 : "cc" "memory"
70 : "volatile");
71 a1
72 }
73
74 #[inline(always)]
75 pub unsafe fn syscall4(nr: usize,
76 mut a1: usize,
77 a2: usize,
78 a3: usize,
79 a4: usize)
80 -> usize {
81 llvm_asm!("t 109
82 bcc,pt %xcc, 1f
83 sub %g0, %o0, %o0
84 1:"
85 : "+{o0}"(a1)
86 : "{g1}"(nr) "{o1}"(a2) "{o2}"(a3) "{o3}"(a4)
87 : "cc" "memory"
88 : "volatile");
89 a1
90 }
91
92 #[inline(always)]
93 pub unsafe fn syscall5(nr: usize,
94 mut a1: usize,
95 a2: usize,
96 a3: usize,
97 a4: usize,
98 a5: usize)
99 -> usize {
100 llvm_asm!("t 109
101 bcc,pt %xcc, 1f
102 sub %g0, %o0, %o0
103 1:"
104 : "+{o0}"(a1)
105 : "{g1}"(nr) "{o1}"(a2) "{o2}"(a3) "{o3}"(a4) "{o4}"(a5)
106 : "cc" "memory"
107 : "volatile");
108 a1
109 }
110
111 #[inline(always)]
112 pub unsafe fn syscall6(nr: usize,
113 mut a1: usize,
114 a2: usize,
115 a3: usize,
116 a4: usize,
117 a5: usize,
118 a6: usize)
119 -> usize {
120 llvm_asm!("t 109
121 bcc,pt %xcc, 1f
122 sub %g0, %o0, %o0
123 1:"
124 : "+{o0}"(a1)
125 : "{g1}"(nr) "{o1}"(a2) "{o2}"(a3) "{o3}"(a4) "{o4}"(a5)
126 "{o5}"(a6)
127 : "cc" "memory"
128 : "volatile");
129 a1
130 }