1 | /** @file
|
---|
2 | *
|
---|
3 | * VBox storage devices:
|
---|
4 | * PIIX3 ATA busmaster controller definitions
|
---|
5 | */
|
---|
6 |
|
---|
7 | /*
|
---|
8 | * Copyright (C) 2006-2007 innotek GmbH
|
---|
9 | *
|
---|
10 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
11 | * available from http://www.virtualbox.org. This file is free software;
|
---|
12 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
13 | * General Public License as published by the Free Software Foundation,
|
---|
14 | * in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
|
---|
15 | * distribution. VirtualBox OSE is distributed in the hope that it will
|
---|
16 | * be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
17 | *
|
---|
18 | * If you received this file as part of a commercial VirtualBox
|
---|
19 | * distribution, then only the terms of your commercial VirtualBox
|
---|
20 | * license agreement apply instead of the previous paragraph.
|
---|
21 | */
|
---|
22 |
|
---|
23 | #ifndef __PIIX3ATABmDma_h__
|
---|
24 | #define __PIIX3ATABmDma_h__
|
---|
25 |
|
---|
26 |
|
---|
27 | /** @defgroup grp_piix3atabmdma PIIX3 ATA Bus Master DMA
|
---|
28 | * @{
|
---|
29 | */
|
---|
30 |
|
---|
31 | /** @name BM_STATUS
|
---|
32 | * @{
|
---|
33 | */
|
---|
34 | /** Currently performing a DMA operation. */
|
---|
35 | #define BM_STATUS_DMAING 0x01
|
---|
36 | /** An error occurred during the DMA operation. */
|
---|
37 | #define BM_STATUS_ERROR 0x02
|
---|
38 | /** The DMA unit has raised the IDE interrupt line. */
|
---|
39 | #define BM_STATUS_INT 0x04
|
---|
40 | /** User-defined bit 0, commonly used to signal that drive 0 supports DMA. */
|
---|
41 | #define BM_STATUS_D0DMA 0x20
|
---|
42 | /** User-defined bit 1, commonly used to signal that drive 1 supports DMA. */
|
---|
43 | #define BM_STATUS_D1DMA 0x40
|
---|
44 | /** @} */
|
---|
45 |
|
---|
46 | /** @name BM_CMD
|
---|
47 | * @{
|
---|
48 | */
|
---|
49 | /** Start the DMA operation. */
|
---|
50 | #define BM_CMD_START 0x01
|
---|
51 | /** Data transfer direction: from device to memory if set. */
|
---|
52 | #define BM_CMD_WRITE 0x08
|
---|
53 | /** @} */
|
---|
54 |
|
---|
55 |
|
---|
56 | /** PIIX3 Bus Master DMA unit state. */
|
---|
57 | typedef struct BMDMAState {
|
---|
58 | /** Command register. */
|
---|
59 | uint8_t u8Cmd;
|
---|
60 | /** Status register. */
|
---|
61 | uint8_t u8Status;
|
---|
62 | /** Address of the MMIO region in the guest's memory space. */
|
---|
63 | RTGCPHYS pvAddr;
|
---|
64 | } BMDMAState;
|
---|
65 |
|
---|
66 |
|
---|
67 | /** PIIX3 Bus Master DMA descriptor entry. */
|
---|
68 | typedef struct BMDMADesc {
|
---|
69 | /** Address of the DMA source/target buffer. */
|
---|
70 | RTGCPHYS pBuffer;
|
---|
71 | /** Size of the DMA source/target buffer. */
|
---|
72 | uint32_t cbBuffer;
|
---|
73 | } BMDMADesc;
|
---|
74 |
|
---|
75 | /** @} */
|
---|
76 |
|
---|
77 |
|
---|
78 | #endif /* !__PIIX3ATABmDma_h__ */
|
---|