Skip to content

Commit 7b3b125

Browse files
kelnosMabezDev
authored andcommitted
Teach rust core about Xtensa VaListImpl
1 parent b01f161 commit 7b3b125

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
@@ -212,6 +212,7 @@ impl fmt::Debug for c_void {
212212
not(target_arch = "aarch64"),
213213
not(target_arch = "powerpc"),
214214
not(target_arch = "s390x"),
215+
not(target_arch = "xtensa"),
215216
not(target_arch = "x86_64")
216217
),
217218
all(target_arch = "aarch64", target_vendor = "apple"),
@@ -240,6 +241,7 @@ pub struct VaListImpl<'f> {
240241
not(target_arch = "aarch64"),
241242
not(target_arch = "powerpc"),
242243
not(target_arch = "s390x"),
244+
not(target_arch = "xtensa"),
243245
not(target_arch = "x86_64")
244246
),
245247
all(target_arch = "aarch64", target_vendor = "apple"),
@@ -346,6 +348,24 @@ pub struct VaListImpl<'f> {
346348
_marker: PhantomData<&'f mut &'f c_void>,
347349
}
348350

351+
/// xtensa ABI implementation of a `va_list`.
352+
#[cfg(target_arch = "xtensa")]
353+
#[repr(C)]
354+
#[derive(Debug)]
355+
#[unstable(
356+
feature = "c_variadic",
357+
reason = "the `c_variadic` feature has not been properly tested on \
358+
all supported platforms",
359+
issue = "44930"
360+
)]
361+
#[lang = "va_list"]
362+
pub struct VaListImpl<'f> {
363+
stk: *mut i32,
364+
reg: *mut i32,
365+
ndx: i32,
366+
_marker: PhantomData<&'f mut &'f i32>,
367+
}
368+
349369
/// A wrapper for a `va_list`
350370
#[cfg_attr(not(doc), repr(transparent))] // work around https://github.com/rust-lang/rust/issues/90435
351371
#[derive(Debug)]
@@ -361,6 +381,7 @@ pub struct VaList<'a, 'f: 'a> {
361381
not(target_arch = "aarch64"),
362382
not(target_arch = "powerpc"),
363383
not(target_arch = "s390x"),
384+
not(target_arch = "xtensa"),
364385
not(target_arch = "x86_64")
365386
),
366387
all(target_arch = "aarch64", target_vendor = "apple"),
@@ -375,6 +396,7 @@ pub struct VaList<'a, 'f: 'a> {
375396
target_arch = "aarch64",
376397
target_arch = "powerpc",
377398
target_arch = "s390x",
399+
target_arch = "xtensa",
378400
target_arch = "x86_64"
379401
),
380402
any(not(target_arch = "aarch64"), not(target_vendor = "apple")),
@@ -392,6 +414,7 @@ pub struct VaList<'a, 'f: 'a> {
392414
not(target_arch = "aarch64"),
393415
not(target_arch = "powerpc"),
394416
not(target_arch = "s390x"),
417+
not(target_arch = "xtensa"),
395418
not(target_arch = "x86_64")
396419
),
397420
all(target_arch = "aarch64", target_vendor = "apple"),
@@ -418,6 +441,7 @@ impl<'f> VaListImpl<'f> {
418441
target_arch = "aarch64",
419442
target_arch = "powerpc",
420443
target_arch = "s390x",
444+
target_arch = "xtensa",
421445
target_arch = "x86_64"
422446
),
423447
any(not(target_arch = "aarch64"), not(target_vendor = "apple")),

0 commit comments

Comments
 (0)