This makes the API a bit more convenient to use.
Fixed an inconsistency in the handling of cancelation errors.
We were previously checking for MX_ERR_BAD_STATE which can't happen
during cancelation.
Fixed some minor formatting inconsistencies introduced by the
mxtl->fbl rename.
Added some clarification around thread-safety.
Change-Id: If273a42eea2b869d63c79e47782c28fade339c92
- provide common header and entry structs in bootdata.h
along with documentation comments
- stop treating bootdata headers as part of bootfs
- introduce a simple header with magic and directory size
(allows easy mmap'ing of just the directory)
- align bootdata directory entries on U32 boundaries
- adjust mxio and userboot to deal with the changes
Change-Id: I09f96088f939dd541a6b23d70fcd8606d1af4f28
"xor %eax, %eax" and "xor %rax, %rax" both set %rax=0, but the former
is one byte shorter because it lacks the REX prefix of the latter.
This is not a big win, but it bugs me whenever I look through this
assembly code!
Change-Id: I7eedfc2570c9144d29d229dd92ce2ec15060c707
On an Acer12, this saves about 10 cycles for pushf and 25 cycles for popf.
The pushf+popf had two effects:
1) Preserving flags across kernel scheduler invocations. This
shouldn't be necessary, because the important flags should always
have the same values when the context switch code is called. It
is always called with interrupts disabled; other flags are now
documented in docs/kernel_invariants.md.
2) Setting the initial flags for new kernel threads to the value that
was set in arch_thread_initialize(). This appears not to be
necessary, because the flag values inherited from another kernel
thread ought to be OK.
It appears this popf wasn't sufficient by itself for ensuring that
all kernel threads run with certain flag values, because not all
threads are started via thread_create(). The primary CPU enters
the scheduler via thread_become_idle()'s call to
thread_reschedule(), so the pushf/popf in the context switch would
preserve whatever flags thread_become_idle() was called with.
(Secondary CPUs behave differently: they enter the scheduler via
thread_secondary_cpu_entry()'s call to thread_exit().)
We address that by explicitly resetting flags on CPU startup.
This CL does happen to change the value of IOPL for some kernel code
from 3 to 0, but the value of IOPL doesn't affect ring 0 code.
Change-Id: I330657bfb34ab14a8578062dde42bdc38d27104a
This implementation is sufficient to boot linux with block and balloon
devices, however Magenta guests currently fail to map PCI bars that
don't map MMIO space. For this reason we still default to using the
legacy interface for now.
Change-Id: I873f0bd2285ee1c999a90ec2819b3a512d128039
* Comment tweaks
* magenta_thread_process_name -> get_user_thread_process_name
* Made its user_thread* param const as well, along with
ThreadDispatcher::process().
Remaining "magenta" instances refer to public/magenta or to the name of
the project, not to the old libmagenta.
Change-Id: Idf192c92e559c354a823d35b1f641b80caef8d7f
Removes special casing for usb-audio and usb-cdc-ecm.
Those drivers will instead call usb_claim_additional_interfaces,
indicating what additional interfaces they require.
usb_claim_additional_interfaces will request the list of
descriptors following the interface's existing descriptor list,
and then check whether to claim the interface.
Claiming an interface appends the descriptors to the descriptor list,
and removes any existing child device.
There can be a race condition between a device being created for a child
interface, and an interface claiming that same interface, so there is a
interface mutex and we track the current availability of an interface
via the interface_statuses array.
Change-Id: I3a9599f21c76b85e9a21f561eb259415bde97308
The file really defines the arch interface to exception dispatching.
Remove "magenta" from function names.
Change-Id: I026c6effe2e140f341bfe4fe6e54057e84efda96
- Changes to support USB functions that have multiple interface descriptors
(like USB audio and CDC ethernet)
- Support for enabling/disabling endpoints when alternate interfaces are selected
- Add support for USB functions allocating string descriptors
- Add API for stalling/unstalling endpoints
- Fixes for disconnect handling
- Use new DDK dprintf() in usb-device and ums-function drivers
Change-Id: Id88e8e3816c2dba5dde83d6dbee02c2cde774bff
The USB HID spec says that if any report ID is given in the report
descriptor, it should be used in every report. We were previously
assuming that it would only be included if more than one report ID was
specified.
Change-Id: I206340ff53579ef6aa6019b97362f2198326b55d
This simplifies the check in _x86_copy_to_or_from_user(). The
assembly code can access the global rather than having to take
smap_avail as an argument.
This is more of a cleanup than a performance improvement. Though
x86_feature_test() isn't trivial, it doesn't appear to add noticeable
overhead to the context switch.
Change-Id: I93529a0093366a212ae9214ac0e0ffc886ff1595
This mirrors the VMX check in the x86, and helps us to early exit when
creating a hypervisor guest if it's not supported on the device.
Also split the hypervisor.cpp file into guest.cpp and vcpu.cpp. It's
still a skeleton, but it helps while we flesh it out.
Change-Id: I482f55b5a448c6b26acb363ec3bad76a9ed8c5dc
This makes vmar_allocate consistent with all other system calls,
where a bad user pointer for a result parameter is not diagnosed
until the call has succeeded in every other way.
Change-Id: I7d7c3c51665d8b81370c9da3349f90f502963bdb
Added some more documentation especially to clarify destructor behavior.
Removed virtual destructors since the classes were made final by the
previous refactoring.
Tidied up some assertions to be more consistent and informative.
Change-Id: Ifa7c1a99e22548c59baf9bb666219790b3096b73
-Disable interrupts around the memset/memcpy tests to improve the results
-Switch some macroized stuff to templates
-Increase the buffer sizes to generally include all of the platform's L2 cache
Change-Id: I098c82547171dcdc68ca26096bd6fdfd327edf04
This allows filesystems themselves to decide
what 'unmount' means for their lifecycle (i.e., clean
up and exit process, hang, do nothing, etc).
The VFS layer, managing mounts, still invokes
"UninstallAll".
MG-1115 #done
Change-Id: I9460563d060b447da0e2d478e643fe1f4a419975
"vfs_create_root_handle" should *only* create a new
handle to the root -- it should assume the root
is using a preexisting dispatcher, and not try to
create another.
Change-Id: I07da60571d9cee40d4bcaa0059557952c6d0acfe
arm64_elX_to_el1 is already called from arm_reset in start.S before
lk_main is invoked, and neither the hikey960 or qemu seem to require
arm64_el3_to_el1.
This also removes some duplication between the two functions, for
example with hypervisor setup.
Change-Id: If94ce0e298e52ca39bed1a4a0b5a06f2e3eab5c6