Skip to content

Commit 571ca6a

Browse files
kelnosMabezDev
authored andcommitted
Teach rust core about Xtensa VaListImpl
1 parent 68d46ff commit 571ca6a

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
@@ -236,6 +236,7 @@ impl fmt::Debug for c_void {
236236
not(target_arch = "aarch64"),
237237
not(target_arch = "powerpc"),
238238
not(target_arch = "s390x"),
239+
not(target_arch = "xtensa"),
239240
not(target_arch = "x86_64")
240241
),
241242
all(target_arch = "aarch64", any(target_os = "macos", target_os = "ios")),
@@ -265,6 +266,7 @@ pub struct VaListImpl<'f> {
265266
not(target_arch = "aarch64"),
266267
not(target_arch = "powerpc"),
267268
not(target_arch = "s390x"),
269+
not(target_arch = "xtensa"),
268270
not(target_arch = "x86_64")
269271
),
270272
all(target_arch = "aarch64", any(target_os = "macos", target_os = "ios")),
@@ -372,6 +374,24 @@ pub struct VaListImpl<'f> {
372374
_marker: PhantomData<&'f mut &'f c_void>,
373375
}
374376

377+
/// xtensa ABI implementation of a `va_list`.
378+
#[cfg(target_arch = "xtensa")]
379+
#[repr(C)]
380+
#[derive(Debug)]
381+
#[unstable(
382+
feature = "c_variadic",
383+
reason = "the `c_variadic` feature has not been properly tested on \
384+
all supported platforms",
385+
issue = "44930"
386+
)]
387+
#[lang = "va_list"]
388+
pub struct VaListImpl<'f> {
389+
stk: *mut i32,
390+
reg: *mut i32,
391+
ndx: i32,
392+
_marker: PhantomData<&'f mut &'f i32>,
393+
}
394+
375395
/// A wrapper for a `va_list`
376396
#[cfg_attr(not(doc), repr(transparent))] // work around https://github.com/rust-lang/rust/issues/90435
377397
#[derive(Debug)]
@@ -387,6 +407,7 @@ pub struct VaList<'a, 'f: 'a> {
387407
not(target_arch = "aarch64"),
388408
not(target_arch = "powerpc"),
389409
not(target_arch = "s390x"),
410+
not(target_arch = "xtensa"),
390411
not(target_arch = "x86_64")
391412
),
392413
all(target_arch = "aarch64", any(target_os = "macos", target_os = "ios")),
@@ -402,6 +423,7 @@ pub struct VaList<'a, 'f: 'a> {
402423
target_arch = "aarch64",
403424
target_arch = "powerpc",
404425
target_arch = "s390x",
426+
target_arch = "xtensa",
405427
target_arch = "x86_64"
406428
),
407429
any(not(target_arch = "aarch64"), not(any(target_os = "macos", target_os = "ios"))),
@@ -420,6 +442,7 @@ pub struct VaList<'a, 'f: 'a> {
420442
not(target_arch = "aarch64"),
421443
not(target_arch = "powerpc"),
422444
not(target_arch = "s390x"),
445+
not(target_arch = "xtensa"),
423446
not(target_arch = "x86_64")
424447
),
425448
all(target_arch = "aarch64", any(target_os = "macos", target_os = "ios")),
@@ -447,6 +470,7 @@ impl<'f> VaListImpl<'f> {
447470
target_arch = "aarch64",
448471
target_arch = "powerpc",
449472
target_arch = "s390x",
473+
target_arch = "xtensa",
450474
target_arch = "x86_64"
451475
),
452476
any(not(target_arch = "aarch64"), not(any(target_os = "macos", target_os = "ios"))),

0 commit comments

Comments
 (0)