forked from Imagelibrary/seL4
Merge branch master into arm_hyp
Conflicts: include/arch/arm/arch/32/mode/object/structures.h
This commit is contained in:
@@ -30,13 +30,10 @@ typedef struct arch_tcb {
|
||||
#endif
|
||||
} arch_tcb_t;
|
||||
|
||||
/* Ensure TCB size is sane. */
|
||||
#ifdef CONFIG_ARM_HYPERVISOR_SUPPORT
|
||||
#define EXPECTED_TCB_SIZE 144
|
||||
#else
|
||||
#define EXPECTED_TCB_SIZE 140
|
||||
#endif
|
||||
|
||||
enum vm_rights {
|
||||
VMNoAccess = 0,
|
||||
VMKernelOnly = 1,
|
||||
|
||||
@@ -13,9 +13,6 @@
|
||||
|
||||
#include <config.h>
|
||||
|
||||
/* update this when you modify the tcb struct */
|
||||
#define EXPECTED_TCB_SIZE (144 + CONFIG_XSAVE_SIZE)
|
||||
|
||||
#define GDT_NULL 0
|
||||
#define GDT_CS_0 1
|
||||
#define GDT_DS_0 2
|
||||
|
||||
@@ -240,7 +240,6 @@ typedef struct tcb tcb_t;
|
||||
|
||||
/* Ensure object sizes are sane */
|
||||
compile_assert(cte_size_sane, sizeof(cte_t) <= (1 << seL4_SlotBits))
|
||||
compile_assert(tcb_size_expected, sizeof(tcb_t) == EXPECTED_TCB_SIZE)
|
||||
compile_assert(tcb_size_sane,
|
||||
(1 << (TCB_SIZE_BITS)) + sizeof(tcb_t) <= (1 << seL4_TCBBits))
|
||||
compile_assert(ep_size_sane, sizeof(endpoint_t) <= (1 << seL4_EndpointBits))
|
||||
|
||||
@@ -666,6 +666,7 @@ def parse_xml_file(input_file, valid_types):
|
||||
for method in interface.getElementsByTagName("method"):
|
||||
method_name = method.getAttribute("name")
|
||||
method_id = method.getAttribute("id")
|
||||
method_config = method.getAttribute("config")
|
||||
|
||||
#
|
||||
# Get parameters.
|
||||
@@ -685,7 +686,7 @@ def parse_xml_file(input_file, valid_types):
|
||||
input_params.append(Parameter(param_name, param_type))
|
||||
else:
|
||||
output_params.append(Parameter(param_name, param_type))
|
||||
methods.append((interface_name, method_name, method_id, input_params, output_params))
|
||||
methods.append((interface_name, method_name, method_id, input_params, output_params, method_config))
|
||||
|
||||
return (methods, structs)
|
||||
|
||||
@@ -752,7 +753,7 @@ def generate_stub_file(arch, wordsize, input_files, output_file, use_only_ipc_bu
|
||||
result.append("/*")
|
||||
result.append(" * Return types for generated methods.")
|
||||
result.append(" */")
|
||||
for (interface_name, method_name, _, _, output_params) in methods:
|
||||
for (interface_name, method_name, _, _, output_params, _) in methods:
|
||||
results_structure = generate_result_struct(interface_name, method_name, output_params)
|
||||
if results_structure:
|
||||
result.append(results_structure)
|
||||
@@ -763,9 +764,13 @@ def generate_stub_file(arch, wordsize, input_files, output_file, use_only_ipc_bu
|
||||
result.append("/*")
|
||||
result.append(" * Generated stubs.")
|
||||
result.append(" */")
|
||||
for (interface_name, method_name, method_id, inputs, outputs) in methods:
|
||||
for (interface_name, method_name, method_id, inputs, outputs, config) in methods:
|
||||
if config != "":
|
||||
result.append("#ifdef %s" % config)
|
||||
result.append(generate_stub(arch, wordsize, interface_name, method_name,
|
||||
method_id, inputs, outputs, structs, use_only_ipc_buffer))
|
||||
if config != "":
|
||||
result.append("#endif")
|
||||
|
||||
# Print footer.
|
||||
result.append("#endif /* __LIBSEL4_SEL4_CLIENT_H */")
|
||||
|
||||
@@ -153,6 +153,11 @@ maskVMRights(vm_rights_t vm_rights, cap_rights_t cap_rights_mask)
|
||||
return VMReadWrite;
|
||||
}
|
||||
}
|
||||
if (vm_rights == VMReadWrite &&
|
||||
!cap_rights_get_capAllowRead(cap_rights_mask) &&
|
||||
cap_rights_get_capAllowWrite(cap_rights_mask)) {
|
||||
userError("Attempted to make unsupported write only mapping");
|
||||
}
|
||||
return VMKernelOnly;
|
||||
}
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@ import os.path
|
||||
import optparse
|
||||
import re
|
||||
import itertools
|
||||
import tempfile
|
||||
|
||||
from six.moves import range
|
||||
|
||||
@@ -2546,15 +2547,31 @@ class Block:
|
||||
|
||||
return names
|
||||
|
||||
def open_output(filename):
|
||||
"""Open an output file for writing, recording its filename."""
|
||||
class OutputFile(object):
|
||||
def __init__(self, filename, file):
|
||||
self.filename = os.path.abspath(filename)
|
||||
self.file = file
|
||||
def write(self, *args, **kwargs):
|
||||
self.file.write(*args, **kwargs)
|
||||
return OutputFile(filename, open(filename, "w"))
|
||||
temp_output_files = []
|
||||
class OutputFile(object):
|
||||
def __init__(self, filename, mode='w', atomic=True):
|
||||
"""Open an output file for writing, recording its filename.
|
||||
If atomic is True, use a temporary file for writing.
|
||||
Call finish_output to finalise all temporary files."""
|
||||
self.filename = os.path.abspath(filename)
|
||||
if atomic:
|
||||
dirname, basename = os.path.split(self.filename)
|
||||
self.file = tempfile.NamedTemporaryFile(
|
||||
mode=mode, dir=dirname, prefix=basename + '.', delete=False)
|
||||
if DEBUG:
|
||||
print('Temp file: %r -> %r' % (self.file.name, self.filename), file=sys.stderr)
|
||||
global temp_output_files
|
||||
temp_output_files.append(self)
|
||||
else:
|
||||
self.file = open(filename, mode)
|
||||
def write(self, *args, **kwargs):
|
||||
self.file.write(*args, **kwargs)
|
||||
|
||||
def finish_output():
|
||||
global temp_output_files
|
||||
for f in temp_output_files:
|
||||
os.rename(f.file.name, f.filename)
|
||||
temp_output_files = []
|
||||
|
||||
## Toplevel
|
||||
if __name__ == '__main__':
|
||||
@@ -2596,7 +2613,7 @@ if __name__ == '__main__':
|
||||
in_file = open(in_filename)
|
||||
|
||||
if len(args) > 1:
|
||||
out_file = open_output(args[1])
|
||||
out_file = OutputFile(args[1])
|
||||
|
||||
#
|
||||
# If generating Isabelle scripts, ensure we have enough information for
|
||||
@@ -2715,7 +2732,7 @@ if __name__ == '__main__':
|
||||
os.path.basename(options.multifile_base).split('.')[0]
|
||||
submodule_name = base_filename + "_" + \
|
||||
e.name + "_defs"
|
||||
out_file = open_output(options.multifile_base + "_" +
|
||||
out_file = OutputFile(options.multifile_base + "_" +
|
||||
e.name + "_defs" + ".thy")
|
||||
|
||||
print("theory %s imports \"%s/KernelState_C\" begin" % (
|
||||
@@ -2787,7 +2804,7 @@ if __name__ == '__main__':
|
||||
os.path.basename(options.multifile_base).split('.')[0]
|
||||
submodule_name = base_filename + "_" + \
|
||||
e.name + "_proofs"
|
||||
out_file = open_output(options.multifile_base + "_" +
|
||||
out_file = OutputFile(options.multifile_base + "_" +
|
||||
e.name + "_proofs" + ".thy")
|
||||
|
||||
print(("theory %s imports "
|
||||
@@ -2811,3 +2828,5 @@ if __name__ == '__main__':
|
||||
for e in itertools.chain(blocks.values(), unions.values()):
|
||||
e.generate(options)
|
||||
print("#endif", file=out_file)
|
||||
|
||||
finish_output()
|
||||
|
||||
Reference in New Issue
Block a user