Commit Graph

433 Commits

Author SHA1 Message Date
Travis Geiselbrecht
2c52edce0b [app][tests] set ENABLE_FPU in arch/x86 targets, enable floating point tests 2015-10-27 13:19:07 -07:00
Travis Geiselbrecht
d394f5b83f [arch][x86] fix a few warnings in x86 code 2015-10-27 13:17:50 -07:00
yu-cheng yu
0400a04945 [arch][x86] This is floating point support for intel x86 and x86-64.
Change-Id: Id0b0e2b69c1d27832eb656935e944c04681b324a
2015-10-27 13:04:45 -07:00
Travis Geiselbrecht
0e1ce411ba [make] add ability to set EXTRA_LINKER_SCRIPTS in modules
This allows for individual modules to extend the main linker script,
primarily to add their own sections to interate over.
Remove the main shared_* linker scripts.
2015-10-26 16:47:18 -07:00
Travis Geiselbrecht
35ebee0e40 [merge] branch 'heapswitch'
This picks up the major work of allowing multiple heap implementations
and enable dlmalloc as an alternate heap to the simple existing one
(now called 'miniheap').

Also added a novm page allocator for memory management on systems too small
or missing an mmu to have a vm. Not much more than a simple bitmap allocator
that the heap pulls from. Allows for other heaps and/or users of physical
memory to coexist and span multiple banks of memory.
2015-10-20 16:53:00 -07:00
Travis Geiselbrecht
88d0001cdc [arch][arm] add lk.elf.stack to the generated list so it gets removed in the clean target 2015-10-19 19:47:29 -07:00
Travis Geiselbrecht
e58d0759ec [arch][multiple] finally solve the linker-script-not-updated problem
If a make variable was modified in a way that would cause the linker
script to need to be regenerated on arches that use generated linker
scripts, make sure we get a fresh copy.

Reuse the same generate-then-replace logic that goes into config.h
files.
2015-10-19 19:43:31 -07:00
Travis Geiselbrecht
3b2d7a268b [make] remove the need for a module to manually add $(LOCAL_DIR)/include to the global include path
Pretty much every module in the system was already doing it, so do it
automatically.
2015-10-19 19:07:16 -07:00
Travis Geiselbrecht
1485131d00 [lib][heap] refactor top level malloc/free into lib/heap
Flatten a level by moving malloc/free/new and friends into lib/heap.
Punch realloc and a few others directly through into the underlying
heap implementation. Remove heap_alloc and heap_free entirely.
2015-10-19 14:57:51 -07:00
Travis Geiselbrecht
7c09e82033 [make] make sure MEMBASE and MEMSIZE are always set exactly once 2015-10-15 17:22:16 -07:00
Arve Hjønnevåg
fb49e1a184 [arch][arm] Dump original svc sp and lr in fault handlers 2015-10-14 13:43:54 -07:00
Travis Geiselbrecht
3d3998eb58 [lib][console] move the panic shell test into console.h and fix a few missing debug.h includes 2015-10-12 18:26:48 -07:00
Travis Geiselbrecht
713e138de9 [arch][x86] clean up the way memory size is detected and the vm initialized
Also fix a few warnings in arch/x86
2015-10-11 14:09:55 -07:00
Travis Geiselbrecht
5a221c4919 [arch][x86-64] add nulled out arch_sync_cache_range 2015-10-11 12:36:04 -07:00
Travis Geiselbrecht
3d096a3e60 [merge] merge pending changes from Intel for x86 and x86-64
Intel repo at https://github.com/srodrig1/lk
2015-10-11 12:27:25 -07:00
Travis Geiselbrecht
2141ec6be5 [arch][x86] stub out arch_cache_sync for x86 2015-10-11 12:01:11 -07:00
Shreyas Nagaraj
d6b1ffe03f [arch][x86] Un-setting the improper flags which was being set for the pdp entries (x86 paging level) in the x86 PAE Mode 2015-10-01 23:47:44 -04:00
Travis Geiselbrecht
e41856c62b [arch][arm] add a routine to enter user space directly 2015-09-24 15:55:51 -07:00
Travis Geiselbrecht
294ded0d57 [kernel][vmm] add support for user address spaces
Still doesn't switch between them, but allows for a separate container
of regions to be created and destroyed.
2015-09-23 17:43:37 -07:00
M1cha
8e0afb2b5e [arch][or1k] get working after SMP changes 2015-09-20 18:20:22 -07:00
Travis Geiselbrecht
641a948c4e [arch][arm-m] add stubbed out cache routines for cortex-ms that dont have a cache 2015-09-20 13:24:22 -07:00
Travis Geiselbrecht
56e5680943 [arch][microblaze] stub out cache routines to get it compiling again 2015-09-20 13:19:40 -07:00
Travis Geiselbrecht
25cf30637f [vm] have the pmm routines return a size_t instead of uint for 64bit compatibility 2015-09-20 12:13:07 -07:00
Travis Geiselbrecht
169c743c27 [arch][arm64] allow floating point code 2015-09-20 12:13:07 -07:00
Arve Hjønnevåg
69ca5903cf [arch][arm64] Implement lazy fpu/simd state loading
If the fpu/simd registers on this cpu were last used by the current
thread and the current thread last used the fpu/simd register on the
current cpu, then the load can be skipped.

We still always save the state, to avoid a situation where a cpu wants
to run a thread where the fpu/simd register state for that thread is
only available in the registers of another cpu.

Change-Id: I062aa0792180b9ec08a5dd95b5f4f6ba165167e1
2015-09-20 12:13:07 -07:00
Arve Hjønnevåg
5ab22dee7f [arch][arm64] Add fpu support
Enable fpu registers on demand. Save and disable them on the next
context switch.

Change-Id: I5a1b98044757fd6de7405a7aff3f87b2315ba74b
2015-09-20 12:13:07 -07:00
Travis Geiselbrecht
6e82ef9722 [arch][arm] cortex-a15 can count the number of cpus as well 2015-09-20 12:13:07 -07:00
Travis Geiselbrecht
e7e894900f [arch][arm64] get compiling again 2015-09-20 12:13:06 -07:00
Travis Geiselbrecht
0f207bbc02 [arch][arm-m] print relevant data on memmanage exceptions 2015-09-17 15:09:53 -07:00
Gurjant Kalsi
a6c8b005db [console] Use STATIC_COMMAND macro for all console command definitions
BUG=

Review URL: https://codereview.chromium.org/1348403002 .
2015-09-16 15:37:33 -07:00
Sergio Rodriguez
e8ad243d42 Merge remote-tracking branch 'upstream/master' 2015-09-11 13:22:16 -07:00
Travis Geiselbrecht
2219bd7c77 [arch][arm] add the bottom bits of the physical address back in arch_mmu_query 2015-09-08 16:15:01 -07:00
Travis Geiselbrecht
aaa1d91347 [arch][arm] fix annoying printf 2015-09-08 16:15:01 -07:00
Christopher Anderson
ebe5167962 [build][toolchain] Fix error with ARCH_arm_TOOLCHAIN_PREFIX usage
If ARCH_arm_TOOLCHAIN_PREFIX was set then by default the makefile would
not set FOUNDTOOL and error out on build claiming no toolchain was found.
This change simply adds a check for gcc in the case that
ARCH_arm_TOOLCHAIN_PREFIX exists.
2015-09-02 14:29:01 -07:00
Travis Geiselbrecht
4bade47a7e [platform][armemu] add support for a fake armemu cpu
For the moment fix it as a armv7-a cpu with no mmu and no thumb.
2015-08-31 22:02:57 -07:00
Travis Geiselbrecht
4a5f8667bd [arch][arm] allow building with the KERNEL_VM and ARM_WITH_MMU turned off 2015-08-31 22:02:57 -07:00
Travis Geiselbrecht
9118a4d605 [merge] merge from the stm32f7 branch
Conflicts:
	arch/arm/arm-m/arch.c
2015-08-28 15:03:17 -07:00
Arve Hjønnevåg
e3c8b5496f [arch][arm64] Update permissions for initial mappings.
Kernel code and rodata sections are now read-only.
Sections and mappings other than kernel code section are
privileged-execute-never.
All mappings are user-execute-never.

Code assumes kernel text section is at start of ram, followed by
rodata then data/bss/free-memory.

Change-Id: I96e27f9a8844594da5e9d033759b90e47adb667f
2015-08-24 15:47:29 -07:00
Arve Hjønnevåg
14de7b0168 [arch][arm][mmu] Fix read-only mappings
Update header file to define missing access permission flags for
privileged read-only with unprivileged read-only or unprivileged
no-access.

Also mark P_RW_U_RO masks as obsolete as they are not compatible
with using AP0 as an access flag.

Change-Id: I51504481514ce5344f96f77fcc2cde28c99f825f
2015-08-24 15:47:29 -07:00
Arve Hjønnevåg
c80cdf9fee [arch][arm][mmu] Add ARCH_MMU_FLAG_PERM_NO_EXECUTE support
Change-Id: I1e0626aba96da60300abe9f6cc936c159679330d
2015-08-24 15:47:29 -07:00
Arve Hjønnevåg
52e691fe40 [arch][arm64][mmu] Add ARCH_MMU_FLAG_PERM_NO_EXECUTE support
Change-Id: If88435a87f4b554774ce9373b444a3ea4c748504
2015-08-24 15:47:29 -07:00
Michael Ryleev
42705b9f0e [arch][arm][mmu] Fix a bug in arch_mmu_query
When query small page we should check MMU_MEMORY_L1_PAGETABLE_NON_SECURE
bit in order to determine if we have non-secure memory.

Change-Id: I59e633b986a50c44e417d17b59bb9cd7eeb20612
2015-08-24 15:47:29 -07:00
Arve Hjønnevåg
a29648636b [arch][arm] Add fault handler table
Allows executing an instruction with a custom fault recovery handler.

Can be used with Load/Store Unprivileged to safely access user-space
memory.

Change-Id: Ic617ece7bf5c2440c257b462af8983dde42e5408
2015-08-24 15:47:29 -07:00
Arve Hjønnevåg
0e6303f74d [arch][arm] Don't share the same stack between multiple modes.
The exception handling code now uses the svc stack pointer, so set the
stack pointer for other modes to 0 to reduce the chance of stack
corruption.

Change-Id: Ic69a9dc15ba9291cbb23ff264112e35126266767
2015-08-24 15:47:29 -07:00
Arve Hjønnevåg
def4d5f78b [arch][arm] Fix prefetch and data abort handling
Save state on current svc stack pointer instead of using a separate
pointer into the same stack. Also allocate space for and save lr
(it was already restored).

Change-Id: I235448c8bc3ced877e2ce5b34c3f3519266f32a7
2015-08-24 15:47:29 -07:00
Arve Hjønnevåg
1b578624ee [arch][arm64] Add fault handler table
Allows executing an instruction with a custom fault recovery handler.

Can be used with Load/Store Unprivileged to safely access user-space
memory.

Change-Id: If5390de06182e4d0409b30a8e6a1b93b7acc77b6
2015-08-24 15:47:29 -07:00
Travis Geiselbrecht
b1024ec276 [arch][arm-m] add cache flush routines for cortex-m cpus that support it 2015-08-21 11:33:05 -07:00
Brian Swetland
4794d7cfe6 [arch][arm-m] debugger info
Use the reserved cortex-m vectors 8 and 9 for a magic cookie and
pointer to a debugger info structure.  This structure contains
pointers to the threadlist, the current thread pointer, and
offsets to important members of the thread structure.  With
this information, an attached debugger can walk the threadlist
and obtain state, name, registers, etc for each thread.

Use global define WITH_DEBUGGER_INFO to enable this.
2015-08-14 15:30:43 -07:00
Brian Swetland
f231bf893a [arch][arm-m] provide _debugmonitor hook 2015-08-05 14:49:03 -07:00
Sergio Rodriguez
99db584f9d Merge remote-tracking branch 'origin/master' 2015-07-29 14:38:22 -07:00