Skip to content

Commit 97c61df

Browse files
kelnosMabezDev
authored andcommitted
Teach rust core about Xtensa VaListImpl
1 parent 9970393 commit 97c61df

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
@@ -241,6 +241,7 @@ impl fmt::Debug for c_void {
241241
not(target_arch = "aarch64"),
242242
not(target_arch = "powerpc"),
243243
not(target_arch = "s390x"),
244+
not(target_arch = "xtensa"),
244245
not(target_arch = "x86_64")
245246
),
246247
all(target_arch = "aarch64", any(target_os = "macos", target_os = "ios", target_os = "tvos")),
@@ -270,6 +271,7 @@ pub struct VaListImpl<'f> {
270271
not(target_arch = "aarch64"),
271272
not(target_arch = "powerpc"),
272273
not(target_arch = "s390x"),
274+
not(target_arch = "xtensa"),
273275
not(target_arch = "x86_64")
274276
),
275277
all(target_arch = "aarch64", any(target_os = "macos", target_os = "ios", target_os = "tvos")),
@@ -377,6 +379,24 @@ pub struct VaListImpl<'f> {
377379
_marker: PhantomData<&'f mut &'f c_void>,
378380
}
379381

382+
/// xtensa ABI implementation of a `va_list`.
383+
#[cfg(target_arch = "xtensa")]
384+
#[repr(C)]
385+
#[derive(Debug)]
386+
#[unstable(
387+
feature = "c_variadic",
388+
reason = "the `c_variadic` feature has not been properly tested on \
389+
all supported platforms",
390+
issue = "44930"
391+
)]
392+
#[lang = "va_list"]
393+
pub struct VaListImpl<'f> {
394+
stk: *mut i32,
395+
reg: *mut i32,
396+
ndx: i32,
397+
_marker: PhantomData<&'f mut &'f i32>,
398+
}
399+
380400
/// A wrapper for a `va_list`
381401
#[cfg_attr(not(doc), repr(transparent))] // work around https://github.com/rust-lang/rust/issues/90435
382402
#[derive(Debug)]
@@ -392,6 +412,7 @@ pub struct VaList<'a, 'f: 'a> {
392412
not(target_arch = "aarch64"),
393413
not(target_arch = "powerpc"),
394414
not(target_arch = "s390x"),
415+
not(target_arch = "xtensa"),
395416
not(target_arch = "x86_64")
396417
),
397418
all(
@@ -410,6 +431,7 @@ pub struct VaList<'a, 'f: 'a> {
410431
target_arch = "aarch64",
411432
target_arch = "powerpc",
412433
target_arch = "s390x",
434+
target_arch = "xtensa",
413435
target_arch = "x86_64"
414436
),
415437
any(
@@ -431,6 +453,7 @@ pub struct VaList<'a, 'f: 'a> {
431453
not(target_arch = "aarch64"),
432454
not(target_arch = "powerpc"),
433455
not(target_arch = "s390x"),
456+
not(target_arch = "xtensa"),
434457
not(target_arch = "x86_64")
435458
),
436459
all(target_arch = "aarch64", any(target_os = "macos", target_os = "ios", target_os = "tvos")),
@@ -458,6 +481,7 @@ impl<'f> VaListImpl<'f> {
458481
target_arch = "aarch64",
459482
target_arch = "powerpc",
460483
target_arch = "s390x",
484+
target_arch = "xtensa",
461485
target_arch = "x86_64"
462486
),
463487
any(

0 commit comments

Comments
 (0)