Cleanup c programs (#1620)

Cleanup C programs
This commit is contained in:
jackcmay
2018-10-26 19:38:07 -07:00
committed by GitHub
parent 9a6a399a29
commit 3488ea7d1c
27 changed files with 629 additions and 786 deletions

View File

@@ -0,0 +1,15 @@
extern crate rbpf;
use std::mem::transmute;
#[no_mangle]
#[link_section = ".text,entrypoint"] // TODO platform independent needed
pub extern "C" fn entrypoint(_raw: *mut u8) {
let bpf_func_trace_printk = unsafe {
transmute::<u64, extern "C" fn(u64, u64, u64, u64, u64)>(
rbpf::helpers::BPF_TRACE_PRINTK_IDX as u64,
)
};
bpf_func_trace_printk(0, 0, 1, 2, 3);
}