Merge tag 'v3.14.25' into backport/v3.14.24-ltsi-rc1+v3.14.25/snapshot-merge.wip
[platform/adaptation/renesas_rcar/renesas_kernel.git] / drivers / staging / ktap / runtime / lib_ffi.c
1 /*
2  * ffi.c - ktapvm kernel module ffi library
3  *
4  * This file is part of ktap by Jovi Zhangwei.
5  *
6  * Copyright (C) 2012-2013 Jovi Zhangwei <jovi.zhangwei@gmail.com>.
7  *
8  * ktap is free software; you can redistribute it and/or modify it
9  * under the terms and conditions of the GNU General Public License,
10  * version 2, as published by the Free Software Foundation.
11  *
12  * ktap is distributed in the hope it will be useful, but WITHOUT
13  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
15  * more details.
16  *
17  * You should have received a copy of the GNU General Public License along with
18  * this program; if not, write to the Free Software Foundation, Inc.,
19  * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
20  */
21
22 #include "../include/ktap_types.h"
23 #include "../include/ktap_ffi.h"
24 #include "ktap.h"
25 #include "kp_vm.h"
26
27 /*@TODO Design how to implement ffi helper functions  22.11 2013 (unihorn)*/
28
29 static int kp_ffi_new(ktap_state *ks)
30 {
31         /*@TODO finish this  08.11 2013 (houqp)*/
32         return 0;
33 }
34
35 static int kp_ffi_sizeof(ktap_state *ks)
36 {
37         /*@TODO finish this  08.11 2013 (houqp)*/
38         return 0;
39 }
40
41 static const ktap_Reg ffi_funcs[] = {
42         {"sizeof", kp_ffi_sizeof},
43         {"new", kp_ffi_new},
44         {NULL}
45 };
46
47 void kp_init_ffilib(ktap_state *ks)
48 {
49         kp_register_lib(ks, "ffi", ffi_funcs);
50 }