Skip to content

Commit a0215ea

Browse files
kelnosMabezDev
authored andcommitted
Teach rust core about Xtensa VaListImpl
1 parent 8724b12 commit a0215ea

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
@@ -237,6 +237,7 @@ impl fmt::Debug for c_void {
237237
not(target_arch = "aarch64"),
238238
not(target_arch = "powerpc"),
239239
not(target_arch = "s390x"),
240+
not(target_arch = "xtensa"),
240241
not(target_arch = "x86_64")
241242
),
242243
all(target_arch = "aarch64", any(target_os = "macos", target_os = "ios", target_os = "tvos")),
@@ -266,6 +267,7 @@ pub struct VaListImpl<'f> {
266267
not(target_arch = "aarch64"),
267268
not(target_arch = "powerpc"),
268269
not(target_arch = "s390x"),
270+
not(target_arch = "xtensa"),
269271
not(target_arch = "x86_64")
270272
),
271273
all(target_arch = "aarch64", any(target_os = "macos", target_os = "ios", target_os = "tvos")),
@@ -373,6 +375,24 @@ pub struct VaListImpl<'f> {
373375
_marker: PhantomData<&'f mut &'f c_void>,
374376
}
375377

378+
/// xtensa ABI implementation of a `va_list`.
379+
#[cfg(target_arch = "xtensa")]
380+
#[repr(C)]
381+
#[derive(Debug)]
382+
#[unstable(
383+
feature = "c_variadic",
384+
reason = "the `c_variadic` feature has not been properly tested on \
385+
all supported platforms",
386+
issue = "44930"
387+
)]
388+
#[lang = "va_list"]
389+
pub struct VaListImpl<'f> {
390+
stk: *mut i32,
391+
reg: *mut i32,
392+
ndx: i32,
393+
_marker: PhantomData<&'f mut &'f i32>,
394+
}
395+
376396
/// A wrapper for a `va_list`
377397
#[cfg_attr(not(doc), repr(transparent))] // work around https://github.com/rust-lang/rust/issues/90435
378398
#[derive(Debug)]
@@ -388,6 +408,7 @@ pub struct VaList<'a, 'f: 'a> {
388408
not(target_arch = "aarch64"),
389409
not(target_arch = "powerpc"),
390410
not(target_arch = "s390x"),
411+
not(target_arch = "xtensa"),
391412
not(target_arch = "x86_64")
392413
),
393414
all(
@@ -406,6 +427,7 @@ pub struct VaList<'a, 'f: 'a> {
406427
target_arch = "aarch64",
407428
target_arch = "powerpc",
408429
target_arch = "s390x",
430+
target_arch = "xtensa",
409431
target_arch = "x86_64"
410432
),
411433
any(
@@ -427,6 +449,7 @@ pub struct VaList<'a, 'f: 'a> {
427449
not(target_arch = "aarch64"),
428450
not(target_arch = "powerpc"),
429451
not(target_arch = "s390x"),
452+
not(target_arch = "xtensa"),
430453
not(target_arch = "x86_64")
431454
),
432455
all(target_arch = "aarch64", any(target_os = "macos", target_os = "ios", target_os = "tvos")),
@@ -454,6 +477,7 @@ impl<'f> VaListImpl<'f> {
454477
target_arch = "aarch64",
455478
target_arch = "powerpc",
456479
target_arch = "s390x",
480+
target_arch = "xtensa",
457481
target_arch = "x86_64"
458482
),
459483
any(

0 commit comments

Comments
 (0)