NeKernel dev
Loading...
Searching...
No Matches
AHCI.h File Reference

AHCI support. More...

#include <NeKit/Defines.h>
#include <modules/ACPI/ACPI.h>

Go to the source code of this file.

Classes

struct  FisRegH2D
struct  FisRegD2H
struct  FisData
struct  FisPioSetup
struct  FisDmaSetup
struct  FisDevBits
struct  HbaPort
 ifndef kSATAGHC_AE More...
struct  HbaMem
struct  HbaCmdHeader
union  HbaCmdHeader::HbaFlags
struct  HbaCmdHeader::HbaFlags::HbaFlags_
union  HbaFlags
struct  HbaFlags::HbaFlags_
struct  HbaFis
struct  HbaPrdtEntry
struct  HbaCmdTbl

Macros

#define kAHCISectorSize   (512)
#define kSATAGHC_AE   (31)
 Enable AHCI device bit in GHC register.

Typedefs

typedef struct FisRegH2D FisRegH2D
typedef struct FisRegD2H FisRegD2H
typedef struct FisData FisData
typedef struct FisPioSetup FisPioSetup
typedef struct FisDmaSetup FisDmaSetup
typedef struct FisDevBits FisDevBits
typedef struct HbaPort HbaPort
 ifndef kSATAGHC_AE
typedef struct HbaMem HbaMem
typedef HbaMemHbaMemRef
typedef struct HbaFis HbaFis
typedef struct HbaPrdtEntry HbaPrdtEntry
typedef struct HbaCmdTbl HbaCmdTbl

Enumerations

enum  {
  kFISTypeRegH2D = 0x27 , kFISTypeRegD2H = 0x34 , kFISTypeDMAAct = 0x39 , kFISTypeDMASetup = 0x41 ,
  kFISTypeData = 0x46 , kFISTypeBIST = 0x58 , kFISTypePIOSetup = 0x5F , kFISTypeDevBits = 0xA1
}
 Frame information type. More...
enum  {
  kAHCICmdIdentify = 0xEC , kAHCICmdReadDma = 0xC8 , kAHCICmdReadDmaEx = 0x25 , kAHCICmdWriteDma = 0xCA ,
  kAHCICmdWriteDmaEx = 0x35
}

Functions

struct HbaCmdHeader ATTRIBUTE (packed, aligned(32)) HbaCmdHeader
Kernel::Boolean drv_std_init (Kernel::UInt16 &PortsImplemented)
 Initializes an AHCI disk.
Kernel::Boolean drv_std_detected (Kernel::Void)
Kernel::Void drv_std_read (Kernel::UInt64 lba, Kernel::Char *buf, Kernel::SizeT sector_sz, Kernel::SizeT buf_sz)
 Read from AHCI disk.
Kernel::Void drv_std_write (Kernel::UInt64 lba, Kernel::Char *buf, Kernel::SizeT sector_sz, Kernel::SizeT buf_sz)
 Write to AHCI disk.
Kernel::SizeT drv_std_get_sector_count ()
 Gets the sector count from AHCI disk.
Kernel::SizeT drv_std_get_size ()
 Gets the AHCI disk size.
Kernel::Bool drv_is_ready (void)
 Checks if the drive has completed the command.

Variables

union HbaFlags HbaFlags
Kernel::UInt16 Prdtl
Kernel::UInt32 Prdbc
Kernel::UInt32 Ctba
Kernel::UInt32 Ctbau
Kernel::UInt32 Rsv [4]

Detailed Description

AHCI support.

Macro Definition Documentation

◆ kAHCISectorSize

#define kAHCISectorSize   (512)

◆ kSATAGHC_AE

#define kSATAGHC_AE   (31)

Enable AHCI device bit in GHC register.

Typedef Documentation

◆ FisData

typedef struct FisData FisData

◆ FisDevBits

typedef struct FisDevBits FisDevBits

◆ FisDmaSetup

typedef struct FisDmaSetup FisDmaSetup

◆ FisPioSetup

typedef struct FisPioSetup FisPioSetup

◆ FisRegD2H

typedef struct FisRegD2H FisRegD2H

◆ FisRegH2D

typedef struct FisRegH2D FisRegH2D

◆ HbaCmdTbl

typedef struct HbaCmdTbl HbaCmdTbl

◆ HbaFis

typedef struct HbaFis HbaFis

◆ HbaMem

typedef struct HbaMem HbaMem

◆ HbaMemRef

typedef HbaMem* HbaMemRef

◆ HbaPort

typedef struct HbaPort HbaPort

ifndef kSATAGHC_AE

◆ HbaPrdtEntry

typedef struct HbaPrdtEntry HbaPrdtEntry

Enumeration Type Documentation

◆ anonymous enum

anonymous enum

Frame information type.

Enumerator
kFISTypeRegH2D 
kFISTypeRegD2H 
kFISTypeDMAAct 
kFISTypeDMASetup 
kFISTypeData 
kFISTypeBIST 
kFISTypePIOSetup 
kFISTypeDevBits 

◆ anonymous enum

anonymous enum
Enumerator
kAHCICmdIdentify 
kAHCICmdReadDma 
kAHCICmdReadDmaEx 
kAHCICmdWriteDma 
kAHCICmdWriteDmaEx 

Function Documentation

◆ ATTRIBUTE()

struct HbaCmdHeader ATTRIBUTE ( packed ,
aligned(32)  )

◆ drv_is_ready()

Kernel::Bool drv_is_ready ( void )

Checks if the drive has completed the command.

◆ drv_std_detected()

Kernel::Boolean drv_std_detected ( Kernel::Void )

◆ drv_std_get_sector_count()

Kernel::SizeT drv_std_get_sector_count ( )

Gets the sector count from AHCI disk.

◆ drv_std_get_size()

Kernel::SizeT drv_std_get_size ( )

Gets the AHCI disk size.

◆ drv_std_init()

Kernel::Boolean drv_std_init ( Kernel::UInt16 & PortsImplemented)

Initializes an AHCI disk.

Parameters
PortsImplementedthe amount of port that have been detected.
Returns

◆ drv_std_read()

Kernel::Void drv_std_read ( Kernel::UInt64 lba,
Kernel::Char * buf,
Kernel::SizeT sector_sz,
Kernel::SizeT buf_sz )

Read from AHCI disk.

Parameters
lba
buf
sector_sz
buf_sz
Returns

◆ drv_std_write()

Kernel::Void drv_std_write ( Kernel::UInt64 lba,
Kernel::Char * buf,
Kernel::SizeT sector_sz,
Kernel::SizeT buf_sz )

Write to AHCI disk.

Parameters
lba
buf
sector_sz
buf_sz
Returns

Variable Documentation

◆ Ctba

◆ Ctbau

◆ HbaFlags

union HbaFlags HbaFlags

◆ Prdbc

◆ Prdtl

◆ Rsv