Flash Translation Layer  1.0
Functions | Variables
module.c File Reference

this deal the initialization and removing of the module More...

#include <assert.h>
#include "include/flash.h"
#include "include/module.h"
#include "include/page.h"
#include "include/log.h"
Include dependency graph for module.c:

Functions

int module_init (const int modnum, struct flash_device **__flash, uint64_t flags)
 generic initializer for initialize the module More...
 
int module_exit (struct flash_device *flash)
 free resources in the flash module and submodule More...
 

Variables

static int(* submodule_init [])(struct flash_device *, uint64_t)
 submodule list table More...
 

Detailed Description

this deal the initialization and removing of the module

Author
Gijun Oh
Version
0.1
Date
2021-09-22

Function Documentation

◆ module_exit()

int module_exit ( struct flash_device flash)

free resources in the flash module and submodule

Parameters
flashpointer of the flash device information
Returns
zero to success, error number to fail
Here is the call graph for this function:

◆ module_init()

int module_init ( const int  modnum,
struct flash_device **  __flash,
uint64_t  flags 
)

generic initializer for initialize the module

Parameters
modnummodule number described in the include/module.h
__flashdouble pointer of the flash device information
flagsflags for flash and submodule
Returns
zero to success, error number to fail
Note
This function allocates the memory to the __flash. And you must not change this function!!
Here is the call graph for this function:

Variable Documentation

◆ submodule_init

int(* submodule_init[])(struct flash_device *, uint64_t)
static
Initial value:
= {
}
int page_ftl_module_init(struct flash_device *flash, uint64_t flags)
initialize the page flash translation layer module
Definition: page-interface.c:336

submodule list table

Parameters
flashpointer of the flash device information
intflags for flash module
Note
You must follow the submodule index in the include/module.h