My Project
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Classes | Macros | Typedefs | Functions | Variables
sw_modinit.h File Reference
#include <sw_list.h>
#include <sw_types.h>

Go to the source code of this file.

Classes

struct  sw_file_operations
 
struct  sw_devices_head
 This contains the list of devices registered during Initialisation. More...
 

Macros

#define __init   __attribute__((section(".init")))
 
#define __mod_init   __attribute__((section(".mod_init"))) __attribute__((used))
 
#define __mod_exit   __attribute__((section(".mod_exit"))) __attribute__((used))
 
#define SW_MODULE_INIT(fn)   static __mod_init mod_init_fn_call mod_init_fn = fn
 
#define SW_MODULE_EXIT(fn)   static __mod_exit mod_exit_fn_call mod_exit_fn = fn
 

Typedefs

typedef void(* mod_init_fn_call )(void)
 Typedef of initialization functions in all the modules. More...
 
typedef void(* mod_exit_fn_call )(void)
 Typedef of function called during module exit. More...
 

Functions

void sw_open ()
 open system call for devices More...
 
void sw_close ()
 close system call for devices More...
 
void sw_read (void)
 Read system call for devices. More...
 
void sw_write ()
 write system call for devices More...
 
void sw_ioctl (void)
 ioctl system call for devices More...
 
void sw_device_register (struct sw_file_operations *sw_dev)
 This function is called by each module for registration. More...
 
void sw_device_unregister (struct sw_file_operations *sw_dev)
 This function is called by each module to unregister them. More...
 
void modules_init (void)
 This function calls the initialization function of all the modules. More...
 

Variables

struct sw_devices_head sw_dev_head
 

Macro Definition Documentation

#define __init   __attribute__((section(".init")))
#define __mod_exit   __attribute__((section(".mod_exit"))) __attribute__((used))
#define __mod_init   __attribute__((section(".mod_init"))) __attribute__((used))
#define SW_MODULE_EXIT (   fn)    static __mod_exit mod_exit_fn_call mod_exit_fn = fn
#define SW_MODULE_INIT (   fn)    static __mod_init mod_init_fn_call mod_init_fn = fn

Typedef Documentation

typedef void(* mod_exit_fn_call)(void)

Typedef of function called during module exit.

Parameters
None
Returns
None
typedef void(* mod_init_fn_call)(void)

Typedef of initialization functions in all the modules.

Parameters
None
Returns
None

Function Documentation

void modules_init ( void  )

This function calls the initialization function of all the modules.

void sw_close ( )

close system call for devices

void sw_device_register ( struct sw_file_operations sw_dev)

This function is called by each module for registration.

Parameters
sw_devFile operations structure of the device
void sw_device_unregister ( struct sw_file_operations sw_dev)

This function is called by each module to unregister them.

Parameters
sw_devFile operations structure of the device
void sw_ioctl ( void  )

ioctl system call for devices

void sw_open ( )

open system call for devices

void sw_read ( void  )

Read system call for devices.

Read system call for devices.

void sw_write ( )

write system call for devices

Variable Documentation

struct sw_devices_head sw_dev_head