On 10/22/21 1:34 AM, Ruinland ChuanTzu Tsai wrote:
+    /* Custom CSR value holder per hart */
+    void *custom_csr_val;
   };

Value singular?  Anyhow, I think that it's a mistake trying to hide the
value structure in another file.  It complicates allocation of the
CPURISCVState, and you have no mechanism by which to migrate the csr values.

What I'm trying to do here is to provide a hook for CSR value storage and let
it being set during CPU initilization. We have heterogeneous harts which
have different sets of CSRs.

I understand that, but the common CPURISCVState should contain the storage for all of the CSRs for every possible hart.

I might have made a different call if we had a more object-y language, but we have C. The difference in size (here exactly one word) is not worth the complication of splitting structures apart.


r~

Reply via email to