-
-
Notifications
You must be signed in to change notification settings - Fork 9
Support for a 'Common raw TRB' type #161
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
Thanks for the comment. I understand your point; certainly, the current
Is this about Ring types? If so, it may be ok, but what methods will the type have?
I'd rather avoid this because ERST entry and TRBs don't have shared fields, or just define Just a thought, but how about defining traits like |
My words might be misleading.
Certainly this can be a solution, but I wanted a type which has at least set/clearing chain bits.
I don't know whether this is your intended usage, but this was not intuitive to me, given that My expected workflow was that
and setting chain bits can be done either directly to the type TRB(between 1 and 2) or after extracting Block type(between 2 and 3), provided that the Block type supports set/clear methods. So to elaborate, I would suggest that:
I feel "a PR is worth a thousand discussions" here. I'll do it shortly. |
Currently, individual TRB types are defined as transparent wrappers of
[u32;4]
with someimpl
s.However speaking about their union types, there are
Allowed
types which I feel inconvenient for several reasons:Allowed
types are not transparently[u32;4]
, so we can't directly push that type into a ring.[u32;4]
block or set/clear cycle bits,are implemented in
Allowed
types by matching discriminator arms.Although I didn't benchmark, this seems quite redundant to me. This possibly is a bottleneck given that the actual methods perform simple enough tasks like setting a bit or return the block itself.
For that entry type, we need a method which takes a Event Ring buffer reference and convert it into an entry.
What would be the type of that buffer argument? Definitely not
&[Allowed]
, and&[[u32;4]]
seems a little bit unclear.Is it okay that an allocated buffer has the type
&[[u32;4]]
?If not, I suggest to add a transparent wrapper for
[u32; 4]
, saypub struct Block(pub(crate) [u32; 4]);
, and define some methods like set/clear cycle bits on it.Then the ERST Entry type will accept
&[Block]
type buffers, and concrete TRB types would wrapBlock
rather than raw[u32; 4]
. (e.g.pub struct NoOp(Block);
instead ofpub struct NoOp([u32;4]);
)The text was updated successfully, but these errors were encountered: