safec  2.1
Safe C Library - ISO TR24731 Bounds Checking Interface
slkm_init.c
Go to the documentation of this file.
1 /*------------------------------------------------------------------
2  * slk_init.c - example kernel module skeleton
3  *
4  * 2012, Jonathan Toppins <jtoppins@users.sourceforge.net>
5  *
6  * Copyright (c) 2012 Cisco Systems, Inc.
7  * All rights reserved.
8  *
9  * Permission is hereby granted, free of charge, to any person
10  * obtaining a copy of this software and associated documentation
11  * files (the "Software"), to deal in the Software without
12  * restriction, including without limitation the rights to use,
13  * copy, modify, merge, publish, distribute, sublicense, and/or
14  * sell copies of the Software, and to permit persons to whom the
15  * Software is furnished to do so, subject to the following
16  * conditions:
17  *
18  * The above copyright notice and this permission notice shall be
19  * included in all copies or substantial portions of the Software.
20  *
21  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
22  * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
23  * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
24  * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
25  * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
26  * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
27  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
28  * OTHER DEALINGS IN THE SOFTWARE.
29  *------------------------------------------------------------------
30  */
31 
32 #include <linux/module.h>
33 #include <linux/kernel.h>
34 #include "../safeclib/safeclib_private.h"
35 
36 #define DRV_NAME "slk"
37 #define DRV_VERSION "0.0"
38 #define DRV_DESCRIPTION "Safe C Library Kernel Module"
39 #define DRV_COPYRIGHT "Copyright(c) 2012 cisco Systems, Inc."
40 
43 MODULE_LICENSE("MIT");
45 MODULE_ALIAS("slk");
46 
47 /*
48  * // example match table... show how to properally mark the table
49  *static const struct of_device_id _match[] __devinitconst = {
50  * {
51  * .compatible = "blah",
52  * .data = (void *) (&_ops),
53  * },
54  * {},
55  *};
56  *MODULE_DEVICE_TABLE(of, _match);
57  */
58 
59 
65 static int __init slk_init(void)
66 {
67  printk(KERN_INFO "%s, v%s - %s\n", DRV_DESCRIPTION, DRV_VERSION,
71  return 0;
72 }
73 
77 static void __exit slk_exit(void)
78 {
79  printk(KERN_INFO "%s called\n", __func__);
80 }
81 
82 /* Module entry and exit points */
module_exit(slk_exit)
#define DRV_COPYRIGHT
Definition: slkm_init.c:39
#define DRV_VERSION
Definition: slkm_init.c:37
static int __init slk_init(void)
Module initialization function.
Definition: slkm_init.c:65
MODULE_DESCRIPTION(DRV_DESCRIPTION)
static void __exit slk_exit(void)
Module exit function.
Definition: slkm_init.c:77
#define DRV_DESCRIPTION
Definition: slkm_init.c:38
void abort_handler_s(const char *restrict msg, void *restrict ptr, errno_t error)
This function writes a message on the standard error stream in an implementation-defined format...
MODULE_AUTHOR(DRV_COPYRIGHT)
MODULE_ALIAS("slk")
module_init(slk_init)
constraint_handler_t set_mem_constraint_handler_s(constraint_handler_t handler)
The set_mem_constraint_handler_s function sets the runtime-constraint handler to be handler...
MODULE_VERSION(DRV_VERSION)
constraint_handler_t set_str_constraint_handler_s(constraint_handler_t handler)
The set_str_constraint_handler_s function sets the runtime-constraint handler to be handler...
MODULE_LICENSE("MIT")