?? bchhwsim.h
字號(hào):
/* Simulaton of the ECC hardware */
/* Prototypes of hardware simulation routines and global constant tables */
/* */
/* If ECC hardware exist these routines are not nesassary */
/* */
/* Algorithms and programming were written by : */
/* */
/* Itai Dror */
/* */
/* Fortress Security Division, Omer */
/* M - Systems, Flash Disk Pioneers */
/* email: itaid@m-sys.com */
/* */
/* */
/* version 1.0, Feb. 2, 2002 */
/* */
/* version 1.02, Dec 10, 2002 */
/* (Disk On Chip naming convention compliance) */
/* */
#ifndef __ECCHardwareSim_h
#define __ECCHardwareSim_h
#include "bch_hm.h"
/* ------------------------------------------------------------------------- */
/* */
/* function: */
/* */
/* void BCH_Parity(FLByte bU[], FLSNative nsnumbytes, FLByte bP[]) */
/* */
/* description: Calculate parity bits for BCH 4 error correction code */
/* */
/* */
/* Perfomance in accelerated using multiplication tables of g(X) */
/* */
/* Input: */
/* bU[] - Page of data */
/* nsnumbytes - Number of data bytes */
/* 1 <= numbytes <= 2040 */
/* */
/* Output: */
/* bP[] - 7 bytes of BCH 4 ECC parity bits */
/* */
/* */
/* ------------------------------------------------------------------------- */
extern void BCH_Parity(FLByte bU[], FLSNative nsnumbytes, FLByte bP[]) ;
/* ------------------------------------------------------------------------- */
/* */
/* function: */
/* */
/* FLSNative BCH_Syndrome(FLByte bV[], FLSNative nsnumbytes, FLByte bS[]) */
/* */
/* description: Calculate syndrome bits for BCH 4 error correction code */
/* */
/* */
/* Perfomance in accelerated using multiplication tables of g(X) */
/* */
/* Input: */
/* bV[] - Page of data + parity bytes */
/* nsnumbytes - Number of data bytes */
/* 1 <= nsnumbytes <= 2040 */
/* */
/* Output: */
/* bS[] - 7 bytes of BCH 4 ECC syndrome bits */
/* */
/* */
/* Returned value: */
/* 0 - Syndrome is not 0 (There are errors) */
/* 1 - Syndrome is 0 (Data is correct) */
/* */
/* ------------------------------------------------------------------------- */
extern FLSNative BCH_Syndrome(FLByte bV[], FLSNative nsnumbytes, FLByte bS[]) ;
/* ------------------------------------------------------------------------- */
/* */
/* function: FLByte Hamming_Parity(FLByte bU[],nsnumbytes) */
/* */
/* description: */
/* */
/* Calculate Hamming parity bits for 1 error correction, 2 errors detection */
/* */
/* Perfomance in accelerated using multiplication tables of Hamming g(X) */
/* */
/* Input: */
/* bU[] - PageInfo bytes */
/* nsnumbytes - Number of bytes */
/* 1 <= nsnumbytes <= 14 */
/* */
/* Returned value: */
/* */
/* 1 byte of parity */
/* */
/* */
/* ------------------------------------------------------------------------- */
extern FLByte Hamming_Parity(FLByte bU[],FLSNative nsnumbytes) ;
/* ------------------------------------------------------------------------- */
/* */
/* function: FLByte Hamming_Syndrome(FLByte bV[],FLSNative nsnumbytes) */
/* */
/* description: */
/* */
/* Calculate Hamming syndrome bits for 1 error correction, 2 errors detection*/
/* */
/* */
/* Perfomance in accelerated using multiplication tables of Hamming g(X) */
/* */
/* Input: */
/* bV[] - PageInfo bytes + paritybyte */
/* nsnumbytes - Number of bytes */
/* 1 <= nsnumbytes <= 14 */
/* */
/* Returned value: */
/* 1 byte of syndrome */
/* */
/* */
/* ------------------------------------------------------------------------- */
extern FLByte Hamming_Syndrome(FLByte bV[],FLSNative nsnumbytes) ;
/* ------------------------------------------------------------------------- */
/* BCH update function */
/* */
/* Algorithms and programming were written by : */
/* */
/* Itai Dror */
/* */
/* Fortress Security Division, Omer */
/* M - Systems, Flash Disk Pioneers */
/* email: itaid@m-sys.com */
/* */
/* */
/* version 1.0, April. 20, 2002 */
/* */
/* ------------------------------------------------------------------------- */
/* */
/* function: */
/* */
/* void BCH_ParityUpdate(FLByte bOldPageInfo[], */
/* FLByte bNewPageInfo[], FLByte bBCHParity[] ) */
/* */
/* */
/* description: */
/* */
/* UpDating BCH parity bytes accoring to the OldPageInfo, */
/* NewPageInfo, and the current BCHParity. */
/* NewParity = OldParity ^ ParityOf( OldPageInfo ^ NewPageInfo ) */
/* This is working because BCH codes are linear. */
/* */
/* Function updates also NewPageInfo[7] which is the hamming parity */
/* byte of NewPageInfo */
/* */
/* Input: */
/* */
/* bOldPageInfo - The page info bytes */
/* */
/* bNewPageInfo - The new page info bytes which replace the old ones */
/* */
/* Input / Output: */
/* */
/* bBCHParity[] - 7 BCH parity bytes. Byte of parity are updated by this */
/* function. */
/* */
/* Output: */
/* */
/* bNewPageInfo[7] - Hamming parity of bNewPageInfo[0..6] */
/* */
/* Returned value : */
/* */
/* None */
/* */
extern void BCH_ParityUpdate(FLByte bOldPageInfo[], FLByte bNewPageInfo[],
FLByte bBCHParity[]) ;
#endif
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -