Turnstone Operating System
Loading...
Searching...
No Matches
efi_disk_impl.c File Reference

efi disk implementation. More...

#include <setup.h>

Classes

struct  efi_disk_impl_context_t
 efi disk implementation context. More...
 

Typedefs

typedef struct efi_disk_impl_context_t efi_disk_impl_context_t
 typedef for efi_disk_impl_context_t.
 

Functions

 MODULE ("turnstone.efi")
 
memory_heap_tefi_disk_impl_get_heap (const disk_or_partition_t *d)
 returns heap. More...
 
uint64_t efi_disk_impl_get_disk_size (const disk_or_partition_t *d)
 returns disk size. More...
 
uint64_t efi_disk_impl_get_block_size (const disk_or_partition_t *d)
 returns block size. More...
 
int8_t efi_disk_impl_write (const disk_or_partition_t *d, uint64_t lba, uint64_t count, uint8_t *data)
 writes data to disk. More...
 
int8_t efi_disk_impl_read (const disk_or_partition_t *d, uint64_t lba, uint64_t count, uint8_t **data)
 reads data from disk. More...
 
int8_t efi_disk_impl_close (const disk_or_partition_t *d)
 closes and frees disk. More...
 
int8_t efi_disk_impl_flush (const disk_or_partition_t *d)
 flushes disk. More...
 
disk_tefi_disk_impl_open (efi_block_io_t *bio)
 opens an efi protocol based disk More...
 

Detailed Description

efi disk implementation.

uses efi block io protocol to implement disk methods.

This work is licensed under TURNSTONE OS Public License. Please read and understand latest version of Licence.

Function Documentation

◆ efi_disk_impl_close()

int8_t efi_disk_impl_close ( const disk_or_partition_t d)

closes and frees disk.

Parameters
[in]ddisk or partition.
Returns
0 on success.

◆ efi_disk_impl_flush()

int8_t efi_disk_impl_flush ( const disk_or_partition_t d)

flushes disk.

Parameters
[in]ddisk or partition.
Returns
0 on success.

◆ efi_disk_impl_get_block_size()

uint64_t efi_disk_impl_get_block_size ( const disk_or_partition_t d)

returns block size.

Parameters
[in]ddisk or partition.
Returns
block size.

◆ efi_disk_impl_get_disk_size()

uint64_t efi_disk_impl_get_disk_size ( const disk_or_partition_t d)

returns disk size.

Parameters
[in]ddisk or partition.
Returns
disk size.

◆ efi_disk_impl_get_heap()

memory_heap_t * efi_disk_impl_get_heap ( const disk_or_partition_t d)

returns heap.

Parameters
[in]ddisk or partition.
Returns
heap.

◆ efi_disk_impl_open()

disk_t * efi_disk_impl_open ( efi_block_io_t bio)

opens an efi protocol based disk

Parameters
[in]bioefi block io protocol
Returns
a disk implementation based on efi protocols.

◆ efi_disk_impl_read()

int8_t efi_disk_impl_read ( const disk_or_partition_t d,
uint64_t  lba,
uint64_t  count,
uint8_t **  data 
)

reads data from disk.

Parameters
[in]ddisk or partition.
[in]lbalogical block address.
[in]countnumber of blocks to read.
[out]datadata to read.
Returns
0 on success.

◆ efi_disk_impl_write()

int8_t efi_disk_impl_write ( const disk_or_partition_t d,
uint64_t  lba,
uint64_t  count,
uint8_t data 
)

writes data to disk.

Parameters
[in]ddisk or partition.
[in]lbalogical block address.
[in]countnumber of blocks to write.
[in]datadata to write.
Returns
0 on success.

◆ MODULE()

MODULE ( "turnstone.efi"  )

module name