Skip to content

Commit adbc110

Browse files
kelnosMabezDev
authored andcommitted
Teach rust core about Xtensa VaListImpl
1 parent d9644b8 commit adbc110

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")),
@@ -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", target_os = "tvos")),
@@ -371,6 +373,24 @@ pub struct VaListImpl<'f> {
371373
_marker: PhantomData<&'f mut &'f c_void>,
372374
}
373375

376+
/// xtensa ABI implementation of a `va_list`.
377+
#[cfg(target_arch = "xtensa")]
378+
#[repr(C)]
379+
#[derive(Debug)]
380+
#[unstable(
381+
feature = "c_variadic",
382+
reason = "the `c_variadic` feature has not been properly tested on \
383+
all supported platforms",
384+
issue = "44930"
385+
)]
386+
#[lang = "va_list"]
387+
pub struct VaListImpl<'f> {
388+
stk: *mut i32,
389+
reg: *mut i32,
390+
ndx: i32,
391+
_marker: PhantomData<&'f mut &'f i32>,
392+
}
393+
374394
/// A wrapper for a `va_list`
375395
#[cfg_attr(not(doc), repr(transparent))] // work around https://github.com/rust-lang/rust/issues/90435
376396
#[derive(Debug)]
@@ -386,6 +406,7 @@ pub struct VaList<'a, 'f: 'a> {
386406
not(target_arch = "aarch64"),
387407
not(target_arch = "powerpc"),
388408
not(target_arch = "s390x"),
409+
not(target_arch = "xtensa"),
389410
not(target_arch = "x86_64")
390411
),
391412
all(
@@ -403,6 +424,7 @@ pub struct VaList<'a, 'f: 'a> {
403424
target_arch = "aarch64",
404425
target_arch = "powerpc",
405426
target_arch = "s390x",
427+
target_arch = "xtensa",
406428
target_arch = "x86_64"
407429
),
408430
any(
@@ -423,6 +445,7 @@ pub struct VaList<'a, 'f: 'a> {
423445
not(target_arch = "aarch64"),
424446
not(target_arch = "powerpc"),
425447
not(target_arch = "s390x"),
448+
not(target_arch = "xtensa"),
426449
not(target_arch = "x86_64")
427450
),
428451
all(target_arch = "aarch64", any(target_os = "macos", target_os = "ios", target_os = "tvos")),
@@ -449,6 +472,7 @@ impl<'f> VaListImpl<'f> {
449472
target_arch = "aarch64",
450473
target_arch = "powerpc",
451474
target_arch = "s390x",
475+
target_arch = "xtensa",
452476
target_arch = "x86_64"
453477
),
454478
any(

0 commit comments

Comments
 (0)