Пример #1
0
static uint32_t test_frame(uintptr_t addr)
{
	uintptr_t frame = addr/0x1000;
	uint32_t idx = INDEX_FROM_BIT(frame);
	uint32_t off = OFFSET_FROM_BIT(frame);
	return (frames[idx] & (0x1 << off));	
}
Пример #2
0
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);
}
Пример #3
0
static void clear_frame(uintptr_t addr)
{
	uintptr_t frame = addr/0x1000;
	uint32_t idx = INDEX_FROM_BIT(frame);
	uint32_t off = OFFSET_FROM_BIT(frame);
	frames[idx] &= ~(0x1 << off);
}
Пример #4
0
u32int test_frame(u32int frame_addr)
{
	u32int frame = frame_addr / 0x1000;
	u32int idx = INDEX_FROM_BIT(frame);
	u32int off = OFFSET_FROM_BIT(frame);
	return frames[idx] & (0x1 << off);
}
Пример #5
0
/* Static function to test if a bit is set */
static unsigned int test_frame(addr frame_addr)
{
    addr frame = frame_addr/0x1000;
    addr idx = INDEX_FROM_BIT(frame);
    addr off = OFFSET_FROM_BIT(frame);
    return (frames[idx] & (0x1 << off));
}
Пример #6
0
static void clear_frame(uint32_t frame_addr)
{
	uint32_t frame = frame_addr/PAGE_SIZ;
	uint32_t idx = INDEX_FROM_BIT(frame);
	uint32_t off = OFFSET_FROM_BIT(frame);
	frames[idx] &= ~(0x1 << off);
}
Пример #7
0
/* Static function to set a bit in the frames bitset */
static void set_frame(addr frame_addr)
{
    addr frame = frame_addr/0x1000;
    addr idx = INDEX_FROM_BIT(frame);
    addr off = OFFSET_FROM_BIT(frame);
    frames[idx] |= (0x1 << off);
}
Пример #8
0
static void clear_frame(uint32_t frame_addr)
{
  uint32_t frame=frame_addr/0x1000;
  uint32_t idx=INDEX_FROM_BIT(frame);
  uint32_t offset=OFFSET_FROM_BIT(frame);
  frames[idx] &= ( ~(1<<offset) );
}
Пример #9
0
static uint32_t test_frame(uint32_t frame_addr)
{
  uint32_t frame=frame_addr/0x1000;
  uint32_t idx=INDEX_FROM_BIT(frame);
  uint32_t offset=OFFSET_FROM_BIT(frame);
  return frames[idx] & (1<<offset);
}
Пример #10
0
static void set_frame(uint32_t frame_addr)
{
	uint32_t frame = frame_addr / 0x1000;
	uint32_t idx = INDEX_FROM_BIT(frame);
	uint32_t off = OFFSET_FROM_BIT(frame);

	_pages[idx] |= (0x1 << off);
}
Пример #11
0
static void set_frame(uint32_t frame_addr)
{
	off_t off;
	uint32_t idx, frame;
	frame = frame_addr/PAGE_SIZ;
	idx = INDEX_FROM_BIT(frame);
	off = OFFSET_FROM_BIT(frame);
	frames[idx] |= (0x1 << off);
}
Пример #12
0
		// Static function to test if a bit is set.
		inline bool operator[]( const size_t &pos ) const {
			//static u32int test_frame(u32int frame_addr)
			//{
//			uint32_t frame = frame_addr/0x1000;
			const uint32_t idx = INDEX_FROM_BIT(pos);
			const uint32_t off = OFFSET_FROM_BIT(pos);
			return (base[idx] & (0x1 << off));
			//}
		}
Пример #13
0
static void set_frame(uintptr_t addr)
{
	if(addr < nframes * 0x1000)
	{
		uint32_t frame = addr/0x1000;
		uint32_t idx = INDEX_FROM_BIT(frame);
		uint32_t off = OFFSET_FROM_BIT(frame);
		frames[idx] |= (0x1 << off);
	}
}
Пример #14
0
		inline void clear( const size_t &pos ){
//			uint32_t frame = frame_addr/0x1000;
			const uint32_t idx = INDEX_FROM_BIT(pos);
			const uint32_t off = OFFSET_FROM_BIT(pos);
			base[idx] &= ~(0x1 << off);
		}
Пример #15
0
		inline void set( const size_t &pos ){
//			u32int frame = frame_addr/0x1000;
			const uint32_t idx = INDEX_FROM_BIT(pos);
			const uint32_t off = OFFSET_FROM_BIT(pos);
			base[idx] |= (0x1 << off);
		}
Пример #16
0
/**
 * Set a bit in the frames bitset as used.
 *
 * @param frame Offset into the array
 */
static inline void set_frame(unsigned int frame) {
	unsigned int idx = INDEX_FROM_BIT(frame);
	unsigned int off = OFFSET_FROM_BIT(frame);
	frames[idx] |= (0x1 << off);
}