Commit Graph

1008 Commits

Author SHA1 Message Date
Michael Ryleev
8ea08267b8 [make][macro] Add definition of TOBOOL macro
This macro converts specified variable to boolean true or false.

Change-Id: I8e5a58a8bd0e241ac666213c931f596110bd08df
2015-03-19 18:01:13 -07:00
Michael Ryleev
833b355a33 [include][err] Add ERR_ACCESS_DENIED error code
Change-Id: I917beb20cec2db85632e4a35d97e5e828f572187
2015-03-19 18:01:13 -07:00
Michael Ryleev
0071fc66eb [kernel][vm] Fixup few end of address space conditions
Change-Id: Ie105016f44d0d8579282713ce901f9c5e75ad408
Signed-off-by: Michael Ryleev <gmar@google.com>
2015-03-19 18:01:13 -07:00
Michael Ryleev
0eb6b97baf [kernel][vm] Add lock around public VMM operations
Change-Id: I873f1dc0ecf49afc790c5012b53a3679048c2a80
2015-03-19 18:01:13 -07:00
Michael Ryleev
acc1a59a07 [kernel][pmm] Add proper end of arena segment check
Change-Id: I25ac3b9bd099b51c95e138a204dc625964d97913
2015-03-19 18:01:12 -07:00
Riley Andrews
cda0a70942 [lib][debug] Add print lock to serialize all kernel debug output.
Change-Id: Ice04378e0b3afebf36b23b06f96e4ea80efbfe9d
2015-03-19 18:01:12 -07:00
Riley Andrews
7053bce539 [lib][debug] Add dwrite function.
dwrite will push a provided number of characters to
debug output. All other print functions require null
terminated strings.

Change-Id: I765366d67e9ef95156264ab8cb43552864395395
2015-03-19 18:01:12 -07:00
Michael Ryleev
110361e64f [arch][arm64][ops] add wmb/rmb barrier definitions
Change-Id: I84c5b68c0911bdf071e3867095529c83448aaf30
2015-03-19 18:01:12 -07:00
Arve Hjønnevåg
b22c0c8d5b [arch][arm64] Add mmu support
Change-Id: I52aa2071bf3b2d1a03b01ab6b1f32a809a3ebebe
2015-03-19 18:01:12 -07:00
Arve Hjønnevåg
cbe13735ca [include][sys][types.h] Change lk_time_t to uint32_t
Use a fixed size for lk_time_t so the same time conversions can
be used on 64 bit and 32 bit systems.

Change-Id: I92ce900fc6b3d783a7d93a05c2ecf8fb236552ad
2015-03-19 18:01:12 -07:00
Arve Hjønnevåg
a17d19dae0 [dev][timer][arm_generic] Add arm64 support and select timer based on TIMER_ARM_GENERIC_SELECTED
TIMER_ARM_GENERIC_SELECTED can be set to CNTP, CNTPS or CNTV. CNTP is
used by default.

Change-Id: Idbce233062f244cee8245f48c6ad272111b7c58b
2015-03-19 18:01:12 -07:00
Arve Hjønnevåg
eed6d25ef3 [dev][interrupt][arm_gic] Add arm64 support
Change-Id: I08b1f60af08fe3d8d20a9f85e8e8c03d78aa6aa8
2015-03-19 18:01:12 -07:00
Arve Hjønnevåg
5a25f43b90 [arch][arm64] Fix ARM64_READ_SYSREG and ARM64_WRITE_SYSREG to work if the register argument is a macro.
Change-Id: Ibcf2438901a0c6fa8fb704ba684fbd0720579c1e
2015-03-19 18:01:12 -07:00
Arve Hjønnevåg
93c70ef1f3 [arch][arm64] Fix compile error on DSB
Add sy argument

Change-Id: Ib71ec52402645d7f80d23184bd8ebee70a401217
2015-03-19 18:01:12 -07:00
Arve Hjønnevåg
bbda0e55cb [arch][arm64] Don't overwrite bootargs
Change-Id: I1b4c856ac3719469c0f3ae0849b71a9bd3814d35
2015-03-19 18:01:12 -07:00
Arve Hjønnevåg
582d0e72cb [arch][arm64] Add calloc_bootmem_aligned asm macro.
Add macro to allocate memory in early boot code. Allocated memory
is aligned to the size requested and cleared. phys_offset must be
supplied if used before the mmu is enabled.

Change-Id: I2c2a96ac83aa81d7ce6e14c786131f0c3de058ba
2015-03-19 18:01:11 -07:00
Arve Hjønnevåg
7c1d131c3a [arch][arm64] Add tbzmask and tbnzmask asm macros
The tbz and tbnz arm64 instructions take a bit number, not a mask.
Add helper macros that convert a bitmask with a single bit set to
a bit number and pass it to the tbz or tbnz instruction.

Change-Id: I8b5f86a1ba91fd0251859324b4baba5296c328e4
2015-03-19 18:01:11 -07:00
Arve Hjønnevåg
8c5bb922b7 [arch][arm64] Move push and pop asm macros to arch/asm_macros.h
Change-Id: Ic101965193304cae3c4aad49b5f2f4f08b2485a3
2015-03-19 18:01:11 -07:00
Arve Hjønnevåg
c175149c52 [kernel][vm] Add 64 bit version of __MMU_INITIAL_MAPPING_* constants.
Change-Id: Id62a6e299fb1fc71d29c5c3722d1941b301f8228
2015-03-19 18:01:11 -07:00
Arve Hjønnevåg
c593fc51a1 [kernel][vm] panic if mark_pages_in_use fails to find the paddr
If mark_pages_in_use fails to mark the kernel code (or data) as used,
it will get corrupted as the heap starts reusing using it.

Change-Id: I48f62bb68dcbad3268304aa2a1e63e9956128064
2015-03-19 18:01:11 -07:00
Arve Hjønnevåg
ee44e7354a [arch][arm64] Support syscalls and interrupts from 32-bit user-space.
Change-Id: I40e28b9b615ffb757bfa71b6d1dfc9b52553b8b7
2015-03-19 18:01:11 -07:00
Arve Hjønnevåg
af1c14e45a [arch][arm64] Call syscall handler if WITH_LIB_SYSCALL is set.
Change-Id: If80bb6919b03b72b072c789364f37b944c1cc937
2015-03-19 18:01:11 -07:00
Arve Hjønnevåg
3000a93c0e [arch][arm64] Set ARCH_COMPILEFLAGS from ARCH_$(ARCH)_COMPILEFLAGS
Change-Id: Ie1b139553e4d526f4a78e7caed3e466a0761446f
2015-03-19 18:01:11 -07:00
Arve Hjønnevåg
1955e8c10d [arch][arm64] Add cache-ops
Change-Id: I49b4279a3019587f4d8e5cb7a766b0b118a99301
2015-03-19 18:01:11 -07:00
Arve Hjønnevåg
d48bb91c78 [arch][arm64] Set IS_64BIT
Change-Id: I4c341bcd501bc35c5067b294eeb4aab0620763cf
2015-03-19 18:01:11 -07:00
Arve Hjønnevåg
0d9f917778 [arch][arm64] Add spinlock support
Change-Id: I978c776d9c96e0059efb9e22deb27f32e2653a85
2015-03-19 18:01:11 -07:00
Arve Hjønnevåg
e6fdfd6776 [arch][arm64] Disable floating point support.
Floating pointer registers are not supported by the current context
switch and init code, so stop the compiler from using them.

Change-Id: Ifc0bea4553c60c8fb826455885e1f12b5249759d
2015-03-19 18:01:11 -07:00
Michael Ryleev
2abaa42aec [kernel][vm] Add MMU_INITIAL_MAPPING_FLAG_DYNAMIC
MMU initial mapping entry marked as dynamic might be fixed up
by platform_reset in order to support memory mappings that cannot
be statically defined.

Change-Id: Iba4dcf538c334f165cfbeded3f96dfd7e4084f62
2015-03-19 18:01:10 -07:00
Michael Ryleev
d5e602de06 [arch][arm] Add an option to compile without vfp support for cortex-a15
If ARM_WITHOUT_VFP_NEON is set to 'true' compile without VFP or NEON support.

Change-Id: Iff8abfe1a89f7b50a11528aa0af7ee6a115cd8dd
2015-03-19 18:01:10 -07:00
Michael Ryleev
806515184d [arch][arm64] Cumulative support for building binaries with multiple toolchains
Change-Id: I597f93cf8b39816419574ff4cad23deb3a5ce118
2015-03-19 18:01:10 -07:00
Michael Ryleev
75066f7050 [arch][arm] Cumulative support for building binaries with multiple toolchains
Change-Id: I5559eb41ecaa631d09e9ddaa952281002ee58306
2015-03-19 18:01:10 -07:00
Michael Ryleev
21a5fd3322 [make] Add support for ARCH_XXX flags
Added architecture specific variables

    ARCH_COMPILEFLAGS
    ARCH_CFLAGS
    ARCH_CPPFLAGS
    ARCH_ASMFLAGS

These variables are passed directly to $(CC) command and
are supposed to have global but architecture specific
settings.

Change-Id: I0929afacb4ad5229f503217ee370e0a84a15f35d
2015-03-19 18:01:10 -07:00
Michael Ryleev
6d352765a1 [make] Add support for EXTRA_BUILDRULES
All makefiles added to EXTRA_BUILDRULES variable
will be included right before processing bulk of build.mk

Change-Id: Ic37e37ea7469ee57e6f6543f378c5d0c1510824b
2015-03-19 18:01:10 -07:00
Michael Ryleev
fba0af578c [make] Cleanup overlay processing order
Add LKROOT to LKINC only if it is not already there.
This would allow to specify particular overlay processing
order if required.

Remove adding separate LKROOT/include to GLOBAL_DEFINES as
It is already a part of LKINC list.

Add all directories specified by LKINC to GLOBAL_LDFLAGS instead
of just LKROOT

Change-Id: Ia61623f88f2c5978182c40b09d98b6e5b84e3955
2015-03-19 18:01:10 -07:00
Michael Ryleev
c22b2f4576 [make] Add STRIP tool
Change-Id: I4ff5c33d4f84b3fcd52cb6ec9953595e68721205
Signed-off-by: Michael Ryleev <gmar@google.com>
2015-03-19 18:01:10 -07:00
Dima Zavin
1f189835a2 [include][err] Define couple IPC related error codes
Change-Id: Ic79ba4bbf7239feefe26d4b332db9b75a212bac9
2015-03-19 18:01:10 -07:00
Dima Zavin
e5a1328754 [include][err] add ERR_FAULT error code
Change-Id: I10ebaff9cb771511a6ade6509cce09d6fde7a8f0
Signed-off-by: Dima Zavin <dima@android.com>
2015-03-19 18:01:10 -07:00
Michael Ryleev
7366ee428f [libc] Add an ability to build libc with external malloc
Change-Id: I0f11542d4b6c6fbf57090a68319cd8d11dc51c9a
2015-03-19 18:01:10 -07:00
Satya Popuri
19c2ea6dc8 [kernel][thread] Hook uthread context switch
thread_resched() calls into libuthread to switch userspace.

Change-Id: Iad8e5ade175316eb784410c369c6473b68b6f5d6
Signed-off-by: Satya Popuri <popuri@google.com>
2015-03-19 18:01:09 -07:00
Arve Hjønnevåg
e92da54410 [dev][timer][arm_generic] Add resume handler
Trigger a timer interrupt on cpu resume since the timer may have been reset.

Change-Id: I38af303f704dc88e2eb053d645ead460b7547937
Signed-off-by: Arve Hjønnevåg <arve@android.com>
2015-03-19 18:01:09 -07:00
Arve Hjønnevåg
1fe28345a0 [dev][interrupt][arm_gic] Re-initialize gicd registers if needed.
Adds shadow registers so secure interrupt state is restored after suspend.
Adds cpu suspend and resume functions.
Disable fiqs in suspend and re-enable in resume.

Change-Id: Ie4a36d55fdd7275267eeeb208e358ab24855ee64
Signed-off-by: Arve Hjønnevåg <arve@android.com>
2015-03-19 18:01:09 -07:00
Aaron Gamble
d6da35afc5 init: Add CPU_RESUME and CPU_SUSPEND flag/type
The CPU_SUSPEND flag/type will be used to save state/disable portions of
lk when entering a suspend state.

The CPU_RESUME flag/type will be used to re-initialize portions of lk
when resuming from a suspended state.

Change-Id: Ia21f845da72552c68c679b24413cdc1138e3968c
2015-03-19 18:01:09 -07:00
Arve Hjønnevåg
615fa16210 [dev][interrupt][arm_gic] Mask all fiqs on fiq entry
Allows multiple fiqs to be registered without one fiq handler
interrupting another and corrupting the return state.

Change-Id: I1ab1bd2e2808d3ff319cc31924e083011ef21fe3
Signed-off-by: Arve Hjønnevåg <arve@android.com>
2015-03-19 18:01:09 -07:00
Arve Hjønnevåg
65324bbc8f [arch][arm] Add alternate secondary entry path
Adds branch to arm_secondary_entry after exception vectors
if WITH_SMP is set.

Change-Id: If10d08e305cb4a183b9b80ef3b959f3dcb947b58
Signed-off-by: Arve Hjønnevåg <arve@android.com>
2015-03-19 18:01:09 -07:00
Arve Hjønnevåg
3d5a0da377 [arm] Cortex-A15 support
Change-Id: Icb8779e485e876080dd76961e88a618afa722171
Signed-off-by: Arve Hjønnevåg <arve@android.com>
2015-03-19 18:01:09 -07:00
Satya Popuri
7a535a0c49 [arch][arm] Do not compile stock arm_syscall if building with LIB_SYSCALL
Change-Id: I2c2c92af77333243e5723d705add3e7d1ee93312
Signed-off-by: Satya Popuri <popuri@google.com>
2015-03-19 18:01:09 -07:00
Arve Hjønnevåg
fa4240db63 [arm] dump current thread pointer and name in dump_fault_frame
Change-Id: I2dab157170d0c58576102c3d72524fcb83e386c5
2015-03-19 18:01:09 -07:00
Dima Zavin
b8c79d3cfd [arm] dump userspace sp/lr when dumping fault frame
Change-Id: I221ff1d7c87d969b3fccaa411045d35e8d0013fd
Signed-off-by: Dima Zavin <dima@android.com>
2015-03-19 18:01:09 -07:00
Arve Hjønnevåg
1da3ab1456 Revert "[vm] remove the static asserts for mmu_initial_mapping table"
This reverts commit ef9d85f27a.
2015-03-19 18:01:09 -07:00
Arve Hjønnevåg
d1f9698c0d Revert "DNC - HACK serialize printf w/spinlock"
This reverts commit de9c8796a6.
2015-03-19 18:01:09 -07:00