Skip to content

Commit 5c64241

Browse files
kelnosMabezDev
authored andcommitted
Teach rust core about Xtensa VaListImpl
1 parent 14d655d commit 5c64241

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
@@ -232,6 +232,7 @@ impl fmt::Debug for c_void {
232232
not(target_arch = "aarch64"),
233233
not(target_arch = "powerpc"),
234234
not(target_arch = "s390x"),
235+
not(target_arch = "xtensa"),
235236
not(target_arch = "x86_64")
236237
),
237238
all(target_arch = "aarch64", any(target_os = "macos", target_os = "ios")),
@@ -261,6 +262,7 @@ pub struct VaListImpl<'f> {
261262
not(target_arch = "aarch64"),
262263
not(target_arch = "powerpc"),
263264
not(target_arch = "s390x"),
265+
not(target_arch = "xtensa"),
264266
not(target_arch = "x86_64")
265267
),
266268
all(target_arch = "aarch64", any(target_os = "macos", target_os = "ios")),
@@ -368,6 +370,24 @@ pub struct VaListImpl<'f> {
368370
_marker: PhantomData<&'f mut &'f c_void>,
369371
}
370372

373+
/// xtensa ABI implementation of a `va_list`.
374+
#[cfg(target_arch = "xtensa")]
375+
#[repr(C)]
376+
#[derive(Debug)]
377+
#[unstable(
378+
feature = "c_variadic",
379+
reason = "the `c_variadic` feature has not been properly tested on \
380+
all supported platforms",
381+
issue = "44930"
382+
)]
383+
#[lang = "va_list"]
384+
pub struct VaListImpl<'f> {
385+
stk: *mut i32,
386+
reg: *mut i32,
387+
ndx: i32,
388+
_marker: PhantomData<&'f mut &'f i32>,
389+
}
390+
371391
/// A wrapper for a `va_list`
372392
#[repr(transparent)]
373393
#[derive(Debug)]
@@ -383,6 +403,7 @@ pub struct VaList<'a, 'f: 'a> {
383403
not(target_arch = "aarch64"),
384404
not(target_arch = "powerpc"),
385405
not(target_arch = "s390x"),
406+
not(target_arch = "xtensa"),
386407
not(target_arch = "x86_64")
387408
),
388409
all(target_arch = "aarch64", any(target_os = "macos", target_os = "ios")),
@@ -398,6 +419,7 @@ pub struct VaList<'a, 'f: 'a> {
398419
target_arch = "aarch64",
399420
target_arch = "powerpc",
400421
target_arch = "s390x",
422+
target_arch = "xtensa",
401423
target_arch = "x86_64"
402424
),
403425
any(not(target_arch = "aarch64"), not(any(target_os = "macos", target_os = "ios"))),
@@ -416,6 +438,7 @@ pub struct VaList<'a, 'f: 'a> {
416438
not(target_arch = "aarch64"),
417439
not(target_arch = "powerpc"),
418440
not(target_arch = "s390x"),
441+
not(target_arch = "xtensa"),
419442
not(target_arch = "x86_64")
420443
),
421444
all(target_arch = "aarch64", any(target_os = "macos", target_os = "ios")),
@@ -443,6 +466,7 @@ impl<'f> VaListImpl<'f> {
443466
target_arch = "aarch64",
444467
target_arch = "powerpc",
445468
target_arch = "s390x",
469+
target_arch = "xtensa",
446470
target_arch = "x86_64"
447471
),
448472
any(not(target_arch = "aarch64"), not(any(target_os = "macos", target_os = "ios"))),

0 commit comments

Comments
 (0)