diff mbox series

[1/8] memory.h: Move MemTxResult type to memattrs.h

Message ID 1501867249-1924-2-git-send-email-peter.maydell@linaro.org
State Superseded
Headers show
Series Implement ARM external abort handling | expand

Commit Message

Peter Maydell Aug. 4, 2017, 5:20 p.m. UTC
Move the MemTxResult type to memattrs.h. We're going to want to
use it in cpu/qom.h, which doesn't want to include all of
memory.h. In practice MemTxResult and MemTxAttrs are pretty
closely linked since both are used for the new-style
read_with_attrs and write_with_attrs callbacks, so memattrs.h
is a reasonable home for this rather than creating a whole
new header file for it.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

---
 include/exec/memattrs.h | 10 ++++++++++
 include/exec/memory.h   | 10 ----------
 2 files changed, 10 insertions(+), 10 deletions(-)

-- 
2.7.4

Comments

Richard Henderson Aug. 4, 2017, 5:47 p.m. UTC | #1
On 08/04/2017 10:20 AM, Peter Maydell wrote:
> Move the MemTxResult type to memattrs.h. We're going to want to

> use it in cpu/qom.h, which doesn't want to include all of

> memory.h. In practice MemTxResult and MemTxAttrs are pretty

> closely linked since both are used for the new-style

> read_with_attrs and write_with_attrs callbacks, so memattrs.h

> is a reasonable home for this rather than creating a whole

> new header file for it.

> 

> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

> ---

>  include/exec/memattrs.h | 10 ++++++++++

>  include/exec/memory.h   | 10 ----------

>  2 files changed, 10 insertions(+), 10 deletions(-)


Reviewed-by: Richard Henderson <richard.henderson@linaro.org>



r~
Edgar E. Iglesias Aug. 5, 2017, 12:59 a.m. UTC | #2
On Fri, Aug 04, 2017 at 06:20:42PM +0100, Peter Maydell wrote:
> Move the MemTxResult type to memattrs.h. We're going to want to

> use it in cpu/qom.h, which doesn't want to include all of

> memory.h. In practice MemTxResult and MemTxAttrs are pretty

> closely linked since both are used for the new-style

> read_with_attrs and write_with_attrs callbacks, so memattrs.h

> is a reasonable home for this rather than creating a whole

> new header file for it.

> 

> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>


Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>



> ---

>  include/exec/memattrs.h | 10 ++++++++++

>  include/exec/memory.h   | 10 ----------

>  2 files changed, 10 insertions(+), 10 deletions(-)

> 

> diff --git a/include/exec/memattrs.h b/include/exec/memattrs.h

> index e601061..d4a1642 100644

> --- a/include/exec/memattrs.h

> +++ b/include/exec/memattrs.h

> @@ -46,4 +46,14 @@ typedef struct MemTxAttrs {

>   */

>  #define MEMTXATTRS_UNSPECIFIED ((MemTxAttrs) { .unspecified = 1 })

>  

> +/* New-style MMIO accessors can indicate that the transaction failed.

> + * A zero (MEMTX_OK) response means success; anything else is a failure

> + * of some kind. The memory subsystem will bitwise-OR together results

> + * if it is synthesizing an operation from multiple smaller accesses.

> + */

> +#define MEMTX_OK 0

> +#define MEMTX_ERROR             (1U << 0) /* device returned an error */

> +#define MEMTX_DECODE_ERROR      (1U << 1) /* nothing at that address */

> +typedef uint32_t MemTxResult;

> +

>  #endif

> diff --git a/include/exec/memory.h b/include/exec/memory.h

> index 400dd44..1dcd312 100644

> --- a/include/exec/memory.h

> +++ b/include/exec/memory.h

> @@ -112,16 +112,6 @@ static inline void iommu_notifier_init(IOMMUNotifier *n, IOMMUNotify fn,

>      n->end = end;

>  }

>  

> -/* New-style MMIO accessors can indicate that the transaction failed.

> - * A zero (MEMTX_OK) response means success; anything else is a failure

> - * of some kind. The memory subsystem will bitwise-OR together results

> - * if it is synthesizing an operation from multiple smaller accesses.

> - */

> -#define MEMTX_OK 0

> -#define MEMTX_ERROR             (1U << 0) /* device returned an error */

> -#define MEMTX_DECODE_ERROR      (1U << 1) /* nothing at that address */

> -typedef uint32_t MemTxResult;

> -

>  /*

>   * Memory region callbacks

>   */

> -- 

> 2.7.4

> 

>
Alistair Francis Aug. 7, 2017, 11:11 p.m. UTC | #3
On Fri, Aug 4, 2017 at 5:59 PM, Edgar E. Iglesias
<edgar.iglesias@gmail.com> wrote:
> On Fri, Aug 04, 2017 at 06:20:42PM +0100, Peter Maydell wrote:

>> Move the MemTxResult type to memattrs.h. We're going to want to

>> use it in cpu/qom.h, which doesn't want to include all of

>> memory.h. In practice MemTxResult and MemTxAttrs are pretty

>> closely linked since both are used for the new-style

>> read_with_attrs and write_with_attrs callbacks, so memattrs.h

>> is a reasonable home for this rather than creating a whole

>> new header file for it.

>>

>> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

>

> Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>


Reviewed-by: Alistair Francis <alistair.francis@xilinx.com>


Thanks,
Alistair

>

>

>> ---

>>  include/exec/memattrs.h | 10 ++++++++++

>>  include/exec/memory.h   | 10 ----------

>>  2 files changed, 10 insertions(+), 10 deletions(-)

>>

>> diff --git a/include/exec/memattrs.h b/include/exec/memattrs.h

>> index e601061..d4a1642 100644

>> --- a/include/exec/memattrs.h

>> +++ b/include/exec/memattrs.h

>> @@ -46,4 +46,14 @@ typedef struct MemTxAttrs {

>>   */

>>  #define MEMTXATTRS_UNSPECIFIED ((MemTxAttrs) { .unspecified = 1 })

>>

>> +/* New-style MMIO accessors can indicate that the transaction failed.

>> + * A zero (MEMTX_OK) response means success; anything else is a failure

>> + * of some kind. The memory subsystem will bitwise-OR together results

>> + * if it is synthesizing an operation from multiple smaller accesses.

>> + */

>> +#define MEMTX_OK 0

>> +#define MEMTX_ERROR             (1U << 0) /* device returned an error */

>> +#define MEMTX_DECODE_ERROR      (1U << 1) /* nothing at that address */

>> +typedef uint32_t MemTxResult;

>> +

>>  #endif

>> diff --git a/include/exec/memory.h b/include/exec/memory.h

>> index 400dd44..1dcd312 100644

>> --- a/include/exec/memory.h

>> +++ b/include/exec/memory.h

>> @@ -112,16 +112,6 @@ static inline void iommu_notifier_init(IOMMUNotifier *n, IOMMUNotify fn,

>>      n->end = end;

>>  }

>>

>> -/* New-style MMIO accessors can indicate that the transaction failed.

>> - * A zero (MEMTX_OK) response means success; anything else is a failure

>> - * of some kind. The memory subsystem will bitwise-OR together results

>> - * if it is synthesizing an operation from multiple smaller accesses.

>> - */

>> -#define MEMTX_OK 0

>> -#define MEMTX_ERROR             (1U << 0) /* device returned an error */

>> -#define MEMTX_DECODE_ERROR      (1U << 1) /* nothing at that address */

>> -typedef uint32_t MemTxResult;

>> -

>>  /*

>>   * Memory region callbacks

>>   */

>> --

>> 2.7.4

>>

>>

>
diff mbox series

Patch

diff --git a/include/exec/memattrs.h b/include/exec/memattrs.h
index e601061..d4a1642 100644
--- a/include/exec/memattrs.h
+++ b/include/exec/memattrs.h
@@ -46,4 +46,14 @@  typedef struct MemTxAttrs {
  */
 #define MEMTXATTRS_UNSPECIFIED ((MemTxAttrs) { .unspecified = 1 })
 
+/* New-style MMIO accessors can indicate that the transaction failed.
+ * A zero (MEMTX_OK) response means success; anything else is a failure
+ * of some kind. The memory subsystem will bitwise-OR together results
+ * if it is synthesizing an operation from multiple smaller accesses.
+ */
+#define MEMTX_OK 0
+#define MEMTX_ERROR             (1U << 0) /* device returned an error */
+#define MEMTX_DECODE_ERROR      (1U << 1) /* nothing at that address */
+typedef uint32_t MemTxResult;
+
 #endif
diff --git a/include/exec/memory.h b/include/exec/memory.h
index 400dd44..1dcd312 100644
--- a/include/exec/memory.h
+++ b/include/exec/memory.h
@@ -112,16 +112,6 @@  static inline void iommu_notifier_init(IOMMUNotifier *n, IOMMUNotify fn,
     n->end = end;
 }
 
-/* New-style MMIO accessors can indicate that the transaction failed.
- * A zero (MEMTX_OK) response means success; anything else is a failure
- * of some kind. The memory subsystem will bitwise-OR together results
- * if it is synthesizing an operation from multiple smaller accesses.
- */
-#define MEMTX_OK 0
-#define MEMTX_ERROR             (1U << 0) /* device returned an error */
-#define MEMTX_DECODE_ERROR      (1U << 1) /* nothing at that address */
-typedef uint32_t MemTxResult;
-
 /*
  * Memory region callbacks
  */