Skip to content

Commit 531ecc3

Browse files
kelnosMabezDev
authored andcommitted
Teach rust core about Xtensa VaListImpl
1 parent 278b481 commit 531ecc3

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

library/core/src/ffi/va_list.rs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ use crate::ops::{Deref, DerefMut};
1515
not(target_arch = "aarch64"),
1616
not(target_arch = "powerpc"),
1717
not(target_arch = "s390x"),
18+
not(target_arch = "xtensa"),
1819
not(target_arch = "x86_64")
1920
),
2021
all(target_arch = "aarch64", target_vendor = "apple"),
@@ -37,6 +38,7 @@ pub struct VaListImpl<'f> {
3738
not(target_arch = "aarch64"),
3839
not(target_arch = "powerpc"),
3940
not(target_arch = "s390x"),
41+
not(target_arch = "xtensa"),
4042
not(target_arch = "x86_64")
4143
),
4244
all(target_arch = "aarch64", target_vendor = "apple"),
@@ -113,6 +115,24 @@ pub struct VaListImpl<'f> {
113115
_marker: PhantomData<&'f mut &'f c_void>,
114116
}
115117

118+
/// Xtensa ABI implementation of a `va_list`.
119+
#[cfg(target_arch = "xtensa")]
120+
#[repr(C)]
121+
#[derive(Debug)]
122+
#[unstable(
123+
feature = "c_variadic",
124+
reason = "the `c_variadic` feature has not been properly tested on \
125+
all supported platforms",
126+
issue = "44930"
127+
)]
128+
#[lang = "va_list"]
129+
pub struct VaListImpl<'f> {
130+
stk: *mut i32,
131+
reg: *mut i32,
132+
ndx: i32,
133+
_marker: PhantomData<&'f mut &'f i32>,
134+
}
135+
116136
/// A wrapper for a `va_list`
117137
#[repr(transparent)]
118138
#[derive(Debug)]
@@ -122,6 +142,7 @@ pub struct VaList<'a, 'f: 'a> {
122142
not(target_arch = "aarch64"),
123143
not(target_arch = "powerpc"),
124144
not(target_arch = "s390x"),
145+
not(target_arch = "xtensa"),
125146
not(target_arch = "x86_64")
126147
),
127148
all(target_arch = "aarch64", target_vendor = "apple"),
@@ -136,6 +157,7 @@ pub struct VaList<'a, 'f: 'a> {
136157
target_arch = "aarch64",
137158
target_arch = "powerpc",
138159
target_arch = "s390x",
160+
target_arch = "xtensa",
139161
target_arch = "x86_64"
140162
),
141163
any(not(target_arch = "aarch64"), not(target_vendor = "apple")),
@@ -153,6 +175,7 @@ pub struct VaList<'a, 'f: 'a> {
153175
not(target_arch = "aarch64"),
154176
not(target_arch = "powerpc"),
155177
not(target_arch = "s390x"),
178+
not(target_arch = "xtensa"),
156179
not(target_arch = "x86_64")
157180
),
158181
all(target_arch = "aarch64", target_vendor = "apple"),
@@ -173,6 +196,7 @@ impl<'f> VaListImpl<'f> {
173196
target_arch = "aarch64",
174197
target_arch = "powerpc",
175198
target_arch = "s390x",
199+
target_arch = "xtensa",
176200
target_arch = "x86_64"
177201
),
178202
any(not(target_arch = "aarch64"), not(target_vendor = "apple")),

0 commit comments

Comments
 (0)