Re: using bit-field to define a qom register

2021-07-14 Thread Hiroko Shimizu
Thank you! I understand what you said and I could realize what I want to make. Best regards, Hiroko 2021年7月11日(日) 18:13 Peter Maydell : > On Sun, 11 Jul 2021 at 09:12, Hiroko Shimizu > wrote: > > > > >If you mean the MemoryRegionOps read and write functions, > > Yes, I mean that. I understand

Re: using bit-field to define a qom register

2021-07-11 Thread Peter Maydell
On Sun, 11 Jul 2021 at 09:12, Hiroko Shimizu wrote: > > >If you mean the MemoryRegionOps read and write functions, > Yes, I mean that. I understand that "MemoryRegionOps read and write > functions, those work only with byte offsets." > But, I must set a value into a qom register using C bit

Re: using bit-field to define a qom register

2021-07-11 Thread Hiroko Shimizu
>If you mean the MemoryRegionOps read and write functions, Yes, I mean that. I understand that "MemoryRegionOps read and write functions, those work only with byte offsets." But, I must set a value into a qom register using C bit fields in the guest source code. If I use the extract32/deposit32

Re: using bit-field to define a qom register

2021-07-10 Thread Peter Maydell
On Sat, 10 Jul 2021 at 03:02, Hiroko Shimizu wrote: > Anyway, if you access the second bit, does the read/write function > offset value become 1 bit automatically? If you mean the MemoryRegionOps read and write functions, those work only with byte offsets, because the guest CPU cannot make

Re: using bit-field to define a qom register

2021-07-09 Thread Hiroko Shimizu
2021年7月9日(金) 20:27 Peter Maydell : > On Fri, 9 Jul 2021 at 09:55, Hiroko Shimizu wrote: > > > >> Hello, > >> I would like to access a 4byte-register in 1bit unit. > >> So, I was supposed to use a bit field to define a register like this. > >> > >> typedef

Re: using bit-field to define a qom register

2021-07-09 Thread Peter Maydell
On Fri, 9 Jul 2021 at 09:55, Hiroko Shimizu wrote: > > Hello, > I would like to access a 4byte-register in 1bit unit. > So, I was supposed to use a bit field to define a register like this. > > typedef struct register{ > // define register B >

using bit-field to define a qom register

2021-07-09 Thread Hiroko Shimizu
Hello, I would like to access a 4byte-register in 1bit unit. So, I was supposed to use a bit field to define a register like this. typedef struct register{ // define register B uint32_t B1 : 1; uint32_t B2 : 1; uint32_t B3 : 30; }register;