Commit Graph

25 Commits

Author SHA1 Message Date
Travis Geiselbrecht
df32504748 [kernel] test run sorting some includes
No functional change.
2019-07-13 17:21:00 -07:00
Travis Geiselbrecht
6cb02526b7 [include][console] split lib/console.h into two
TL;DR most uses of lib/console.h -> lk/console_cmd.h

Move the part that lets a piece of code somewhere in the system to
define a console command from the actual lib/console api to start an
instance of the console. Move in almost every place the user of the
console command definition to the new header, lk/console_cmd.h which is
always in the include path.

Also remove most uses of testing for WITH_LIB_CONSOLE since you can
almost always just safely define it and then let the linker remove it.
2019-07-13 16:56:33 -07:00
Travis Geiselbrecht
85a50ea3f4 [kernel][license] try out using a smaller version of the license header
Replace the body of the MIT license with a reference to the LICENSE file
and a URL with the MIT license. Replaces 20 something lines with 3.

No functional change.
2019-06-19 23:28:14 -07:00
Travis Geiselbrecht
d8fa82cb91 [formatting] run everything through codestyle
Almost nothing changes here except moving braces to the same line as the
function declaration. Everything else is largely whitespace changes and
a few dangling files with tab indents.

See scripts/codestyle
2019-06-19 21:02:24 -07:00
Travis Geiselbrecht
1b7a28efb8 [include][lk] fixup lk/ include path move 2019-06-19 19:46:11 -07:00
Travis Geiselbrecht
2a51111387 [kernel] add more controlled way to switch vmm address spaces 2016-02-23 21:07:22 -08:00
Travis Geiselbrecht
14a4c60172 [kernel][vm] get rid of external declaration of address_to_page 2016-02-16 15:25:31 -08:00
Travis Geiselbrecht
9a5cd5c529 [kernel][vm] add support for multiple user address spaces
Generically add support for more than one user address space,
attach to a thread, and context switch as thread swaps happen.

Add support for ARM and ARM64, and stub out support for x86 platforms.
2016-02-16 15:24:25 -08:00
Travis Geiselbrecht
2eb32a4369 [style] mass reformat all the non external code to 4 space indents
Ran everything through scripts/codestyle.space, which uses astyle
to generally follow K&R style.

Biggest non whitespace change is pulling brackets down on function
declarations, which I'm pretty ambivalent about, but astyle insists
on taking a stance
2016-02-14 12:24:01 -08:00
Travis Geiselbrecht
16b1b594f4 [kernel][vm] fix error handling in vmm_alloc in case it can't allocate enough physical memory 2015-10-16 16:09:08 -07:00
Travis Geiselbrecht
6df1116275 [kernel][vmm] fix logic bug in vmm_free_aspace() 2015-09-23 18:03:29 -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
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
Michael Ryleev
18192509eb [kernel][vm] Fix a bug in vm address allocator
Pass arch_mmu_flags (instead of flags) to arch_mmu_pick_spot routine.
This bug would mostly affect ARMv7 platforms with enabled support
for non-secure memory.

Change-Id: Ic97ee6d3f05528170d66ab5033b24adf1d0c514e
2015-08-24 15:47:29 -07:00
Michael Ryleev
210fbbde75 [kernel][vm] Add support for arch_mmu_pick_spot routine
Some architectures might have resrictions on selecting
virtual address depending on properties of particular
VM allocation. This CL allows arch to provide a hook into
virtual address allocator to handle such restictions.

Change-Id: I28e912dcf2cf260b7e6666b6a9384178e41bfa73
2015-03-19 18:01:13 -07:00
Michael Ryleev
f2eb7c75b0 [kernel][vm] Add alignment parameter to vmm_alloc_physical
Change-Id: I516402908e05b5f4b455f79c18fafd795f1f8455
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
ecca4f4aa0 [kernel][vm] Add vmm_free_region and kvaddr_to_paddr
Change-Id: Ieb7a11dcd6d7cd96bfef252b41cc7ccdd4892b8f
2014-11-04 15:30:32 -08:00
Travis Geiselbrecht
b0882ed618 [vmm] add support for allocating aligned contiguous regions
-new argument, align_pow2, will try to allocate physical and virtually
aligned pages.
2014-08-18 14:50:03 -07:00
Travis Geiselbrecht
cb41b90187 [vm] allow config space to set kernel address space size, ARM sets to top 3GB 2014-07-24 15:26:34 -07:00
Travis Geiselbrecht
e35c99d004 [kernel][vm] fix debug code to compile if console disabled 2014-07-24 02:59:24 -07:00
Travis Geiselbrecht
1ffc542896 [kernel][vm] Require pre-initialized lists for pmm routines, clean up docs in header 2014-07-17 18:30:36 -07:00
Travis Geiselbrecht
8637522be0 [kernel][vm] squelch the debug trace spew 2014-07-16 21:05:46 -07:00
Travis Geiselbrecht
986d1590cb [kernel][vm] first stab at a virtual memory manager
Add kernel/vm code to handle memory management in large page-aligned
regions of virtual space. This is composed via a pmm (physical
memory manager) and vmm (virtual memory manager) and the architecturally
specific code to manage the mmu.

Add ARMv7 paging code.
2014-07-11 18:06:37 -07:00