-
Notifications
You must be signed in to change notification settings - Fork 13
/
pagemap.h
58 lines (45 loc) · 3.69 KB
/
pagemap.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/*****************************************************************************************************************************
This project was supported by the National Basic Research 973 Program of China under Grant No.2011CB302301
Huazhong University of Science and Technology (HUST) Wuhan National Laboratory for Optoelectronics
FileName: pagemap.h
Author: Hu Yang Version: 2.1 Date:2011/12/02
Description:
History:
<contributor> <time> <version> <desc> <e-mail>
Yang Hu 2009/09/25 1.0 Creat SSDsim [email protected]
2010/05/01 2.x Change
Zhiming Zhu 2011/07/01 2.0 Change [email protected]
Shuangwu Zhang 2011/11/01 2.1 Change [email protected]
Chao Ren 2011/07/01 2.0 Change [email protected]
Hao Luo 2011/01/01 2.0 Change [email protected]
*****************************************************************************************************************************/
#ifndef PAGEMAP_H
#define PAGEMAP_H 10000
#include <sys/types.h>
#include "initialize.h"
#define MAX_INT64 0x7fffffffffffffffll
void file_assert(int error,char *s);
void trace_assert(int64_t time_t,int device,unsigned int lsn,int size,int ope);
struct local *find_location(struct ssd_info *ssd,unsigned int ppn);
unsigned int find_ppn(struct ssd_info *ssd,unsigned int channel,unsigned int chip,unsigned int die,unsigned int plane,unsigned int block,unsigned int page);
struct ssd_info *pre_process_page(struct ssd_info *ssd);
unsigned int get_ppn_for_pre_process(struct ssd_info *ssd,unsigned int lsn, int mirror);
struct ssd_info *get_ppn(struct ssd_info *ssd,unsigned int channel,unsigned int chip,unsigned int die,unsigned int plane,struct sub_request *sub);
unsigned int gc(struct ssd_info *ssd,unsigned int channel, unsigned int flag);
int gc_direct_erase(struct ssd_info *ssd,unsigned int channel,unsigned int chip,unsigned int die,unsigned int plane);
int uninterrupt_gc(struct ssd_info *ssd,unsigned int channel,unsigned int chip,unsigned int die,unsigned int plane);
int interrupt_gc(struct ssd_info *ssd,unsigned int channel,unsigned int chip,unsigned int die,unsigned int plane,struct gc_operation *gc_node);
int nonblocking_gc(struct ssd_info *ssd,unsigned int channel,unsigned int chip,unsigned int die,unsigned int plane,struct gc_operation *gc_node);
int decide_gc_invoke(struct ssd_info *ssd, unsigned int channel);
int set_entry_state(struct ssd_info *ssd,unsigned int lsn,unsigned int size);
unsigned int get_ppn_for_gc(struct ssd_info *ssd,unsigned int channel,unsigned int chip,unsigned int die,unsigned int plane);
int erase_operation(struct ssd_info * ssd,unsigned int channel ,unsigned int chip ,unsigned int die,unsigned int plane ,unsigned int block);
int erase_planes(struct ssd_info * ssd, unsigned int channel, unsigned int chip, unsigned int die1, unsigned int plane1,unsigned int command);
int move_page(struct ssd_info * ssd, struct local *location,unsigned int * transfer_size);
//int gc_for_channel(struct ssd_info *ssd, unsigned int channel);
int gc_for_channel(struct ssd_info *ssd, unsigned int channel, unsigned int flag);
int delete_gc_node(struct ssd_info *ssd, unsigned int channel,struct gc_operation *gc_node);
int find_active_block(struct ssd_info *ssd,unsigned int channel,unsigned int chip,unsigned int die,unsigned int plane);
int write_page(struct ssd_info *ssd,unsigned int channel,unsigned int chip,unsigned int die,unsigned int plane,unsigned int active_block,unsigned int *ppn);
unsigned int size(unsigned int);
#endif