Vishal Verma wrote:
> Add a cxl_region object to libcxl that represents a CXL region. CXL
> regions are made up of one or more cxl_memdev 'targets'. The
> relationship between a target and a region is conveyed with a
> cxl_memdev_mapping object.
> 
> CXL regions are childeren of root decoders, and are organized as such.
> Mapping objects are childeren of a CXL region.  Introduce the two
> classes of objects themselves, and common accessors related to them.
> 
> Cc: Dan Williams <dan.j.willi...@intel.com>
> Signed-off-by: Vishal Verma <vishal.l.ve...@intel.com>
> ---
>  cxl/lib/private.h  |  34 ++++
>  cxl/lib/libcxl.c   | 421 +++++++++++++++++++++++++++++++++++++++++++--
>  cxl/libcxl.h       |  41 +++++
>  .clang-format      |   2 +
>  cxl/lib/libcxl.sym |  20 +++
>  5 files changed, 508 insertions(+), 10 deletions(-)
> 
> diff --git a/cxl/lib/private.h b/cxl/lib/private.h
> index 832a815..d58a73b 100644
> --- a/cxl/lib/private.h
> +++ b/cxl/lib/private.h
> @@ -116,7 +116,41 @@ struct cxl_decoder {
>       bool accelmem_capable;
>       bool locked;
>       enum cxl_decoder_target_type target_type;
> +     int regions_init;
>       struct list_head targets;
> +     struct list_head regions;
> +};
> +
> +enum cxl_region_commit {
> +     CXL_REGION_COMMIT_UNKNOWN = -1,
> +     CXL_REGION_DECOMMIT = 0,

I had been calling the opposite of the commit operation "reset()". How
about CXL_DECODE_COMMIT, and CXL_DECODE_RESET since it's the "decode"
not the "region" that's being mutated.

However, this isn't an exported definition, only CXL_REGION_COMMIT
appears in code, and nothing else in this patch looks like it needs
updating, so just leave it for now.

Reviewed-by: Dan Williams <dan.j.willi...@intel.com>

Reply via email to