0
I’m seeing the implementation of virtual memory and I have this code:
#define INDEX_FROM_BIT(a) (a / 8*4)
#define OFFSET_FROM_BIT(a)(a % (8*4))
static void set_frame(u32int frame_addr)
{
u32int frame = frame_addr/0x1000;
u32int idx = INDEX_FROM_BIT(frame);
u32int off = OFFSET_FROM_BIT(frame);
frames[idx] |=(0x1 << off);
}
static void clear_frame(u32int frame_addr)
{
u32int frame = frame_addr/0x1000;
u32int idx = INDEX_FROM_BIT(frame);
u32int off = OFFSET_FROM_BIT(frame);
frames[idx] &= ~(0x1 << off);
}
Because that (0x01 << off)
and so used as its context for virtual memory?
Take a look at [tour]. You can accept an answer if it solved your problem. You can vote on every post on the site as well. Did any help you more? You need something to be improved?
– Maniero