[util] Move enum_bitfields into util

Continuing on the cleaning up of the src/include 'junk drawer', the
enum_bitfields.h and its dependency basic_types.h are now in util.
This commit is contained in:
Justin C. Miller
2022-01-03 21:42:20 -08:00
parent c1d9b35e7c
commit 411c8c4cb3
13 changed files with 22 additions and 20 deletions

View File

@@ -7,7 +7,7 @@
#include <j6/errors.h>
#include <j6/flags.h>
#include <j6/syscalls.h>
#include <enum_bitfields.h>
#include <util/enum_bitfields.h>
using bootproto::module_flags;
using bootproto::module_program;
@@ -22,7 +22,7 @@ constexpr uintptr_t stack_top = 0x80000000000;
bool
load_program(const module_program &prog, char *err_msg)
{
if (bitfields::has(prog.mod_flags, module_flags::no_load)) {
if (prog.mod_flags && module_flags::no_load) {
sprintf(err_msg, " skipping pre-loaded program module '%s' at %lx", prog.filename, prog.base_address);
return true;
}
@@ -64,7 +64,7 @@ load_program(const module_program &prog, char *err_msg)
// TODO: way to remap VMA as read-only if there's no write flag on
// the segment
unsigned long flags = j6_vm_flag_write;
if (bitfields::has(seg.flags, elf::segment_flags::exec))
if (seg.flags && elf::segment_flags::exec)
flags |= j6_vm_flag_exec;
j6_handle_t sub_vma = j6_handle_invalid;