Working SDHOST/FatFS, boot partition mounts, some other minor fixes too.
[rpi-open-firmware.git] / arm_chainloader / drivers / block_device.hpp
1 /*=============================================================================
2 Copyright (C) 2016 Kristina Brooks
3 All rights reserved.
4
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License
7 as published by the Free Software Foundation; either version 2
8 of the License, or (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 FILE DESCRIPTION
16 Block device.
17
18 =============================================================================*/
19
20 struct BlockDevice {
21 unsigned int block_size;
22
23 template <typename T>
24 inline bool read_block(uint32_t sector, T* dest_buffer) {
25 read_block(sector, reinterpret_cast<uint32_t*>(dest_buffer));
26 }
27
28 inline unsigned int get_block_size() {
29 return block_size;
30 }
31
32 virtual bool read_block(uint32_t sector, uint32_t* buf) = 0;
33 };
34
35 extern BlockDevice* get_sdhost_device();
This page took 0.0631890000000001 seconds and 4 git commands to generate.