Root/
Source at commit 1164 created 13 years 12 days ago. By azimutz, Add some pauses to nvidia.c and ati.c to help user feedback collection. | |
---|---|
1 | /*␊ |
2 | * Copyright (c) 2011 Evan Lojewski. All rights reserved.␊ |
3 | *␊ |
4 | */␊ |
5 | #include <Partition.hpp>␊ |
6 | ␊ |
7 | Partition::Partition(Disk* disk, UInt8 partitionNumber)␊ |
8 | {␊ |
9 | mDisk = disk;␊ |
10 | mNumSectors = 0;␊ |
11 | mBeginSector = 0;␊ |
12 | mPartitionNumber = partitionNumber;␊ |
13 | mNumPartitions = 0;␊ |
14 | }␊ |
15 | ␊ |
16 | Partition::~Partition()␊ |
17 | {␊ |
18 | ␊ |
19 | }␊ |
20 | ␊ |
21 | IOReturn Partition::Read(UInt64 sector, UInt64 size, UInt8* buffer)␊ |
22 | {␊ |
23 | if(probe() && mDisk->probe()) return mDisk->Read(sector + mBeginSector, size, buffer);␊ |
24 | else return kIOReturnUnsupported;␊ |
25 | }␊ |
26 | ␊ |
27 | IOReturn Partition::Write(UInt64 sector, UInt64 size, UInt8* buffer)␊ |
28 | {␊ |
29 | if(probe() && mDisk->probe()) return mDisk->Write(sector + mBeginSector, size, buffer);␊ |
30 | else return kIOReturnUnsupported;␊ |
31 | }␊ |
32 | ␊ |
33 | bool Partition::probe()␊ |
34 | {␊ |
35 | return (mDisk != NULL) && (mPartitionNumber != INVALID_PARTITION) && mNumSectors;␊ |
36 | }␊ |
37 | ␊ |
38 | /*␊ |
39 | Partition::getUUID()␊ |
40 | {␊ |
41 | return mUUID;␊ |
42 | }␊ |
43 | */ |