Skip to content

Commit e6f1105

Browse files
kelnosMabezDev
authored andcommitted
Teach rust core about Xtensa VaListImpl
1 parent ffcf8cc commit e6f1105

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

library/core/src/ffi/mod.rs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,7 @@ impl fmt::Debug for c_void {
211211
not(target_arch = "aarch64"),
212212
not(target_arch = "powerpc"),
213213
not(target_arch = "s390x"),
214+
not(target_arch = "xtensa"),
214215
not(target_arch = "x86_64")
215216
),
216217
all(target_arch = "aarch64", any(target_os = "macos", target_os = "ios", target_os = "tvos")),
@@ -239,6 +240,7 @@ pub struct VaListImpl<'f> {
239240
not(target_arch = "aarch64"),
240241
not(target_arch = "powerpc"),
241242
not(target_arch = "s390x"),
243+
not(target_arch = "xtensa"),
242244
not(target_arch = "x86_64")
243245
),
244246
all(target_arch = "aarch64", any(target_os = "macos", target_os = "ios", target_os = "tvos")),
@@ -345,6 +347,24 @@ pub struct VaListImpl<'f> {
345347
_marker: PhantomData<&'f mut &'f c_void>,
346348
}
347349

350+
/// xtensa ABI implementation of a `va_list`.
351+
#[cfg(target_arch = "xtensa")]
352+
#[repr(C)]
353+
#[derive(Debug)]
354+
#[unstable(
355+
feature = "c_variadic",
356+
reason = "the `c_variadic` feature has not been properly tested on \
357+
all supported platforms",
358+
issue = "44930"
359+
)]
360+
#[lang = "va_list"]
361+
pub struct VaListImpl<'f> {
362+
stk: *mut i32,
363+
reg: *mut i32,
364+
ndx: i32,
365+
_marker: PhantomData<&'f mut &'f i32>,
366+
}
367+
348368
/// A wrapper for a `va_list`
349369
#[cfg_attr(not(doc), repr(transparent))] // work around https://github.com/rust-lang/rust/issues/90435
350370
#[derive(Debug)]
@@ -360,6 +380,7 @@ pub struct VaList<'a, 'f: 'a> {
360380
not(target_arch = "aarch64"),
361381
not(target_arch = "powerpc"),
362382
not(target_arch = "s390x"),
383+
not(target_arch = "xtensa"),
363384
not(target_arch = "x86_64")
364385
),
365386
all(
@@ -377,6 +398,7 @@ pub struct VaList<'a, 'f: 'a> {
377398
target_arch = "aarch64",
378399
target_arch = "powerpc",
379400
target_arch = "s390x",
401+
target_arch = "xtensa",
380402
target_arch = "x86_64"
381403
),
382404
any(
@@ -397,6 +419,7 @@ pub struct VaList<'a, 'f: 'a> {
397419
not(target_arch = "aarch64"),
398420
not(target_arch = "powerpc"),
399421
not(target_arch = "s390x"),
422+
not(target_arch = "xtensa"),
400423
not(target_arch = "x86_64")
401424
),
402425
all(target_arch = "aarch64", any(target_os = "macos", target_os = "ios", target_os = "tvos")),
@@ -423,6 +446,7 @@ impl<'f> VaListImpl<'f> {
423446
target_arch = "aarch64",
424447
target_arch = "powerpc",
425448
target_arch = "s390x",
449+
target_arch = "xtensa",
426450
target_arch = "x86_64"
427451
),
428452
any(

0 commit comments

Comments
 (0)