slim down generated code

This commit is contained in:
Alwin Berger 2022-02-16 15:18:45 +01:00
parent 1650545424
commit 5bf3269c8f

View File

@ -3,16 +3,14 @@ use serde::{Deserialize, Serialize};
// Manual Types
use libafl_qemu::Emulator;
pub type xLIST_ITEM_ptr = ::std::os::raw::c_uint;
pub type xLIST_ptr = ::std::os::raw::c_uint;
/*========== Start of generated Code =============*/
pub type char_ptr = ::std::os::raw::c_uint;
pub type ListItem_t_ptr = ::std::os::raw::c_uint;
pub type StackType_t_ptr = ::std::os::raw::c_uint;
pub type char_ptr = ::std::os::raw::c_uint;
pub type void_ptr = ::std::os::raw::c_uint;
pub type TCB_t_ptr = ::std::os::raw::c_uint;
pub type tskTaskControlBlock_ptr = ::std::os::raw::c_uint;
pub type xLIST_ptr = ::std::os::raw::c_uint;
pub type xLIST_ITEM_ptr = ::std::os::raw::c_uint;
/* automatically generated by rust-bindgen 0.59.2 */
pub type __uint8_t = ::std::os::raw::c_uchar;
@ -30,69 +28,6 @@ pub struct xLIST_ITEM {
pub pvOwner: void_ptr,
pub pvContainer: xLIST_ptr,
}
#[test]
fn bindgen_test_layout_xLIST_ITEM() {
assert_eq!(
::std::mem::size_of::<xLIST_ITEM>(),
40usize,
concat!("Size of: ", stringify!(xLIST_ITEM))
);
assert_eq!(
::std::mem::align_of::<xLIST_ITEM>(),
8usize,
concat!("Alignment of ", stringify!(xLIST_ITEM))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<xLIST_ITEM>())).xItemValue as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(xLIST_ITEM),
"::",
stringify!(xItemValue)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<xLIST_ITEM>())).pxNext as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(xLIST_ITEM),
"::",
stringify!(pxNext)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<xLIST_ITEM>())).pxPrevious as *const _ as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(xLIST_ITEM),
"::",
stringify!(pxPrevious)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<xLIST_ITEM>())).pvOwner as *const _ as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(xLIST_ITEM),
"::",
stringify!(pvOwner)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<xLIST_ITEM>())).pvContainer as *const _ as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(xLIST_ITEM),
"::",
stringify!(pvContainer)
)
);
}
pub type ListItem_t = xLIST_ITEM;
#[repr(C)]
#[derive(Debug, Copy, Clone, Default, Serialize, Deserialize)]
@ -101,49 +36,6 @@ pub struct xMINI_LIST_ITEM {
pub pxNext: xLIST_ITEM_ptr,
pub pxPrevious: xLIST_ITEM_ptr,
}
#[test]
fn bindgen_test_layout_xMINI_LIST_ITEM() {
assert_eq!(
::std::mem::size_of::<xMINI_LIST_ITEM>(),
24usize,
concat!("Size of: ", stringify!(xMINI_LIST_ITEM))
);
assert_eq!(
::std::mem::align_of::<xMINI_LIST_ITEM>(),
8usize,
concat!("Alignment of ", stringify!(xMINI_LIST_ITEM))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<xMINI_LIST_ITEM>())).xItemValue as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(xMINI_LIST_ITEM),
"::",
stringify!(xItemValue)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<xMINI_LIST_ITEM>())).pxNext as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(xMINI_LIST_ITEM),
"::",
stringify!(pxNext)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<xMINI_LIST_ITEM>())).pxPrevious as *const _ as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(xMINI_LIST_ITEM),
"::",
stringify!(pxPrevious)
)
);
}
pub type MiniListItem_t = xMINI_LIST_ITEM;
#[repr(C)]
#[derive(Debug, Copy, Clone, Default, Serialize, Deserialize)]
@ -152,51 +44,8 @@ pub struct xLIST {
pub pxIndex: ListItem_t_ptr,
pub xListEnd: MiniListItem_t,
}
#[test]
fn bindgen_test_layout_xLIST() {
assert_eq!(
::std::mem::size_of::<xLIST>(),
40usize,
concat!("Size of: ", stringify!(xLIST))
);
assert_eq!(
::std::mem::align_of::<xLIST>(),
8usize,
concat!("Alignment of ", stringify!(xLIST))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<xLIST>())).uxNumberOfItems as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(xLIST),
"::",
stringify!(uxNumberOfItems)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<xLIST>())).pxIndex as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(xLIST),
"::",
stringify!(pxIndex)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<xLIST>())).xListEnd as *const _ as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(xLIST),
"::",
stringify!(xListEnd)
)
);
}
pub type List_t = xLIST;
pub type TaskHandle_t = ::std::os::raw::c_uint;
pub type TaskHandle_t = tskTaskControlBlock_ptr;
pub const eTaskState_eRunning: eTaskState = 0;
pub const eTaskState_eReady: eTaskState = 1;
pub const eTaskState_eBlocked: eTaskState = 2;
@ -205,7 +54,7 @@ pub const eTaskState_eDeleted: eTaskState = 4;
pub const eTaskState_eInvalid: eTaskState = 5;
pub type eTaskState = ::std::os::raw::c_uint;
#[repr(C)]
#[derive(Debug, Copy, Clone, Serialize, Deserialize)]
#[derive(Debug, Copy, Clone, Default, Serialize, Deserialize)]
pub struct xTASK_STATUS {
pub xHandle: TaskHandle_t,
pub pcTaskName: char_ptr,
@ -217,111 +66,6 @@ pub struct xTASK_STATUS {
pub pxStackBase: StackType_t_ptr,
pub usStackHighWaterMark: u16,
}
#[test]
fn bindgen_test_layout_xTASK_STATUS() {
assert_eq!(
::std::mem::size_of::<xTASK_STATUS>(),
72usize,
concat!("Size of: ", stringify!(xTASK_STATUS))
);
assert_eq!(
::std::mem::align_of::<xTASK_STATUS>(),
8usize,
concat!("Alignment of ", stringify!(xTASK_STATUS))
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<xTASK_STATUS>())).xHandle as *const _ as usize },
0usize,
concat!(
"Offset of field: ",
stringify!(xTASK_STATUS),
"::",
stringify!(xHandle)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<xTASK_STATUS>())).pcTaskName as *const _ as usize },
8usize,
concat!(
"Offset of field: ",
stringify!(xTASK_STATUS),
"::",
stringify!(pcTaskName)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<xTASK_STATUS>())).xTaskNumber as *const _ as usize },
16usize,
concat!(
"Offset of field: ",
stringify!(xTASK_STATUS),
"::",
stringify!(xTaskNumber)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<xTASK_STATUS>())).eCurrentState as *const _ as usize },
24usize,
concat!(
"Offset of field: ",
stringify!(xTASK_STATUS),
"::",
stringify!(eCurrentState)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<xTASK_STATUS>())).uxCurrentPriority as *const _ as usize },
32usize,
concat!(
"Offset of field: ",
stringify!(xTASK_STATUS),
"::",
stringify!(uxCurrentPriority)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<xTASK_STATUS>())).uxBasePriority as *const _ as usize },
40usize,
concat!(
"Offset of field: ",
stringify!(xTASK_STATUS),
"::",
stringify!(uxBasePriority)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<xTASK_STATUS>())).ulRunTimeCounter as *const _ as usize },
48usize,
concat!(
"Offset of field: ",
stringify!(xTASK_STATUS),
"::",
stringify!(ulRunTimeCounter)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<xTASK_STATUS>())).pxStackBase as *const _ as usize },
56usize,
concat!(
"Offset of field: ",
stringify!(xTASK_STATUS),
"::",
stringify!(pxStackBase)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<xTASK_STATUS>())).usStackHighWaterMark as *const _ as usize
},
64usize,
concat!(
"Offset of field: ",
stringify!(xTASK_STATUS),
"::",
stringify!(usStackHighWaterMark)
)
);
}
pub type TaskStatus_t = xTASK_STATUS;
#[repr(C)]
#[derive(Debug, Copy, Clone, Default, Serialize, Deserialize)]
@ -331,7 +75,7 @@ pub struct tskTaskControlBlock {
pub xEventListItem: ListItem_t,
pub uxPriority: UBaseType_t,
pub pxStack: StackType_t_ptr,
pub pcTaskName: [::std::os::raw::c_uchar; 10usize],
pub pcTaskName: [::std::os::raw::c_char; 10usize],
pub uxBasePriority: UBaseType_t,
pub uxMutexesHeld: UBaseType_t,
pub ulNotifiedValue: [u32; 1usize],
@ -339,160 +83,9 @@ pub struct tskTaskControlBlock {
pub ucStaticallyAllocated: u8,
pub ucDelayAborted: u8,
}
#[test]
fn bindgen_test_layout_tskTaskControlBlock() {
assert_eq!(
::std::mem::size_of::<tskTaskControlBlock>(),
152usize,
concat!("Size of: ", stringify!(tskTaskControlBlock))
);
assert_eq!(
::std::mem::align_of::<tskTaskControlBlock>(),
8usize,
concat!("Alignment of ", stringify!(tskTaskControlBlock))
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tskTaskControlBlock>())).pxTopOfStack as *const _ as usize
},
0usize,
concat!(
"Offset of field: ",
stringify!(tskTaskControlBlock),
"::",
stringify!(pxTopOfStack)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tskTaskControlBlock>())).xStateListItem as *const _ as usize
},
8usize,
concat!(
"Offset of field: ",
stringify!(tskTaskControlBlock),
"::",
stringify!(xStateListItem)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tskTaskControlBlock>())).xEventListItem as *const _ as usize
},
48usize,
concat!(
"Offset of field: ",
stringify!(tskTaskControlBlock),
"::",
stringify!(xEventListItem)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tskTaskControlBlock>())).uxPriority as *const _ as usize },
88usize,
concat!(
"Offset of field: ",
stringify!(tskTaskControlBlock),
"::",
stringify!(uxPriority)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tskTaskControlBlock>())).pxStack as *const _ as usize },
96usize,
concat!(
"Offset of field: ",
stringify!(tskTaskControlBlock),
"::",
stringify!(pxStack)
)
);
assert_eq!(
unsafe { &(*(::std::ptr::null::<tskTaskControlBlock>())).pcTaskName as *const _ as usize },
104usize,
concat!(
"Offset of field: ",
stringify!(tskTaskControlBlock),
"::",
stringify!(pcTaskName)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tskTaskControlBlock>())).uxBasePriority as *const _ as usize
},
120usize,
concat!(
"Offset of field: ",
stringify!(tskTaskControlBlock),
"::",
stringify!(uxBasePriority)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tskTaskControlBlock>())).uxMutexesHeld as *const _ as usize
},
128usize,
concat!(
"Offset of field: ",
stringify!(tskTaskControlBlock),
"::",
stringify!(uxMutexesHeld)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tskTaskControlBlock>())).ulNotifiedValue as *const _ as usize
},
136usize,
concat!(
"Offset of field: ",
stringify!(tskTaskControlBlock),
"::",
stringify!(ulNotifiedValue)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tskTaskControlBlock>())).ucNotifyState as *const _ as usize
},
144usize,
concat!(
"Offset of field: ",
stringify!(tskTaskControlBlock),
"::",
stringify!(ucNotifyState)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tskTaskControlBlock>())).ucStaticallyAllocated as *const _
as usize
},
145usize,
concat!(
"Offset of field: ",
stringify!(tskTaskControlBlock),
"::",
stringify!(ucStaticallyAllocated)
)
);
assert_eq!(
unsafe {
&(*(::std::ptr::null::<tskTaskControlBlock>())).ucDelayAborted as *const _ as usize
},
146usize,
concat!(
"Offset of field: ",
stringify!(tskTaskControlBlock),
"::",
stringify!(ucDelayAborted)
)
);
}
pub type tskTCB = tskTaskControlBlock;
pub type TCB_t = tskTCB;
/*========== End of generated Code =============*/
pub trait emu_lookup {
fn lookup(emu: &Emulator, addr: ::std::os::raw::c_uint) -> Self;