OpenSSD Cosmos+ Platform Firmware  0.0.2
The firmware of Cosmos+ OpenSSD Platform for TOSHIBA nand flash module.
garbage_collection.h
Go to the documentation of this file.
1
2// garbage_collection.h for Cosmos+ OpenSSD
3// Copyright (c) 2017 Hanyang University ENC Lab.
4// Contributed by Yong Ho Song <yhsong@enc.hanyang.ac.kr>
5// Jaewook Kwak <jwkwak@enc.hanyang.ac.kr>
6//
7// This file is part of Cosmos+ OpenSSD.
8//
9// Cosmos+ OpenSSD is free software; you can redistribute it and/or modify
10// it under the terms of the GNU General Public License as published by
11// the Free Software Foundation; either version 3, or (at your option)
12// any later version.
13//
14// Cosmos+ OpenSSD is distributed in the hope that it will be useful,
15// but WITHOUT ANY WARRANTY; without even the implied warranty of
16// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
17// See the GNU General Public License for more details.
18//
19// You should have received a copy of the GNU General Public License
20// along with Cosmos+ OpenSSD; see the file COPYING.
21// If not, see <http://www.gnu.org/licenses/>.
23
25// Company: ENC Lab. <http://enc.hanyang.ac.kr>
26// Engineer: Jaewook Kwak <jwkwak@enc.hanyang.ac.kr>
27//
28// Project Name: Cosmos+ OpenSSD
29// Design Name: Cosmos+ Firmware
30// Module Name: Garbage Collector
31// File Name: garbage_collection.h
32//
33// Version: v1.0.0
34//
35// Description:
36// - define parameters, data structure and functions of garbage collector
38
40// Revision History:
41//
42// * v1.0.0
43// - First draft
45
46#ifndef GARBAGE_COLLECTION_H_
47#define GARBAGE_COLLECTION_H_
48
49#include "ftl_config.h"
50
52{
53 unsigned int headBlock : 16;
54 unsigned int tailBlock : 16;
56
57typedef struct _GC_VICTIM_MAP
58{
61
62void InitGcVictimMap();
63void GarbageCollection(unsigned int dieNo);
64
65void PutToGcVictimList(unsigned int dieNo, unsigned int blockNo, unsigned int invalidSliceCnt);
66unsigned int GetFromGcVictimList(unsigned int dieNo);
67void SelectiveGetFromGcVictimList(unsigned int dieNo, unsigned int blockNo);
68
70extern unsigned int gcTriggered;
71extern unsigned int copyCnt;
72
73#endif /* GARBAGE_COLLECTION_H_ */
#define SLICES_PER_BLOCK
Definition: ftl_config.h:227
#define USER_DIES
Definition: ftl_config.h:219
struct _GC_VICTIM_LIST_ENTRY GC_VICTIM_LIST_ENTRY
unsigned int gcTriggered
void InitGcVictimMap()
unsigned int GetFromGcVictimList(unsigned int dieNo)
void PutToGcVictimList(unsigned int dieNo, unsigned int blockNo, unsigned int invalidSliceCnt)
struct _GC_VICTIM_MAP GC_VICTIM_MAP
unsigned int copyCnt
void GarbageCollection(unsigned int dieNo)
struct _GC_VICTIM_LIST_ENTRY * P_GC_VICTIM_LIST_ENTRY
void SelectiveGetFromGcVictimList(unsigned int dieNo, unsigned int blockNo)
P_GC_VICTIM_MAP gcVictimMapPtr
struct _GC_VICTIM_MAP * P_GC_VICTIM_MAP
unsigned int tailBlock
unsigned int headBlock
GC_VICTIM_LIST_ENTRY gcVictimList[USER_DIES][SLICES_PER_BLOCK+1]