summaryrefslogtreecommitdiff
path: root/arch/x86/machine/cpu.c
AgeCommit message (Collapse)Author
2018-04-30cpu: add cpu_freq accessor.Remy Noel
2018-04-29Minor changesRichard Braun
2018-01-08Merge branch 'master' into perfmonMocramis
2017-12-03Revert "Make assert have no side effects"Richard Braun
This reverts commit 9c7906d8ad6ebec014b22b8757d916e9cad7d6d3.
2017-10-01Perfmon module prototypeRemy Noel
2017-09-02Make assert have no side effectsRichard Braun
This makes sure symbols referenced by assert uses may not be generated if unused. The recently introduced __unused macro is used to suppress compiler warnings resulting from this change.
2017-07-13Switch to initialization operationsRichard Braun
2017-07-01x86/cpu: register triple fault reset methodRichard Braun
2017-06-25Use the C11 alignas and noreturn macrosRichard Braun
2017-06-25x86/cpu: remove unnecessary qualifiers on the IDT register variableRichard Braun
2017-06-25Remove the param moduleRichard Braun
Move the page properties into the new x86/page module, and the virtual memory layout macros into the x86/pmap module.
2017-06-24Move the DATA_ALIGN and TEXT_ALIGN macros to the x86/cpu moduleRichard Braun
2017-06-24Break STACK_SIZE macro into 3 different macrosRichard Braun
2017-06-10Use log functions where appropriateRichard Braun
2017-06-04x86/{boot,cpu}: move PIT initialization into cpu_measure_freqRichard Braun
2017-06-04x86: support stack smashing protectionRichard Braun
2017-06-03x86: don't unconditionnally initialize the legacy PICRichard Braun
2017-06-03x86/acpimp: rename module to acpiRichard Braun
This module is likely to do more than provide multi-processor information.
2017-05-30Move assert.h to the include directoryRichard Braun
This turns assert.h into a standard header.
2017-05-28x86/cpu: remove apic feature requirementRichard Braun
2017-05-26x86: use the new intr moduleRichard Braun
In particular, the pic and ioapic modules register their respective devices as interrupt controllers. Selection between the legacy XT-PIC and the modern APIC system is made on the availability of ACPI, disregarding the multiprocessor specification entirely. The uart driver is also updated to register devices interrupt handlers.
2017-05-16x86/{cpu,pit}: implement cpu_delay using the timestamp counterRichard Braun
2017-05-10x86/mb: remove moduleRichard Braun
The mb module has never been well defined, and has become irrelevant now that the kern/atomic module has been introduced. Phase it out until the need for non-SMP memory barriers rises.
2017-05-09x86/cpu: test for cmpxchg8b feature in 32 bits modeAgustina Arzille
2017-04-29New stdio.h standard headerRichard Braun
Make kernel code obtain definitions for the printf family of functions through the inclusion of the standard stdio.h header.
2017-04-29kern/printk: rename to printfRichard Braun
The printk functions are close enough to the printf ones to bear the same names.
2017-03-04Add missing braces for one-line blocksRichard Braun
2017-02-04Clean up compilationRichard Braun
Instead of mixing standard headers and internal redefinitions of standard types, completely rely on the compiler for what is guaranteed for a free standing environment. This results in the removal of kern/stddef.h and kern/stdint.h. The kern/types.h header is reintroduced for the different (and saner) purpose of defining types not specified in standard C, namely ssize_t for now.
2017-01-13Replace unsigned long with uintptr_t for integer/pointer conversionsRichard Braun
This is mostly done for the machine-independent part.
2016-12-09Force brackets around one-line conditional statementsRichard Braun
This change was done using astyle, with a few manual editing here and there.
2014-12-10x86/cpu: directmap updateRichard Braun
2014-12-10x86/pmap: directmap updateRichard Braun
This module is probably the most impacted by the direct physical mapping. First, it establishes the direct physical mapping before paging is enabled, and uses the largest available page size when doing so. In addition, the recursive mapping of PTEs is removed, since all page table pages are allocated from the direct physical mapping. This changes the way mapping requests are processed. The ability to access any page table page at any time removes the need for virtual addresses reserved for temporary mappings. Since it's now perfectly possible to return physical address 0 for a kernel mapping, change the interface of the pmap_extract function and rename it to pmap_kextract to stress the fact that it should only be used for kernel mappings.
2014-11-29x86/cpu: fix double fault stack setupRichard Braun
2014-11-17x86/cpu: fix comparisons between pointers and zero.Richard Braun
While not technically a mistake, it's part of the (not yet explicit) coding rules not to compare pointers to zero.
2014-11-17x86/cpu: silence warningRichard Braun
2014-11-17vm/vm_kmem: minor interface updatesRichard Braun
Make functions accept and return pointers instead of integers. Most users of the kernel allocator directly use the returned addresses. Pointers make that more practical.
2014-10-09x86/cpu: include kern/thread.hRichard Braun
2014-10-09kern/xcall: new moduleRichard Braun
Provide cross-processor function calls.
2014-10-04x86/msr: reorder argumentsRichard Braun
2014-10-02x86/cpu: fix CPUID usage on amd64Richard Braun
The cpu_cpuid wrapper used unsigned long integers to store register content, although the CPUID instruction uses 32-bits integers in all modes. This was leading to a corruption of the cpu structures. Fix by using unsigned int integers instead.
2014-10-02x86/cpu: minor fixesRichard Braun
- Move declarations and definitions that are really private into cpu.c. - Use __always_inline where appropriate, not systematically. - Fix headers and comments.
2014-09-05kern/percpu: fix setup of BSP percpu areaRichard Braun
Relocating percpu data is actually tricky, for the same reason relocating memory in general is. There may be pointers to such variables which then become invalid. Instead, keep using the percpu section as the percpu area for the BSP and store the content of the percpu section in dedicated kernel virtual memory. In addition, remove the notification kludge from the x86 cpu module.
2014-09-03x86/cpu: improve percpu supportRichard Braun
- declare CPU descriptors as percpu variables - make the percpu segment register point to the percpu area instead of the CPU descriptor - remove the ugly accessors for the local CPU descriptor, pmap and TCB and use percpu variables for them instead - implement the cpu_local accessors as described in the percpu documentation
2014-09-03kern/percpu: new moduleRichard Braun
Introduce proper per-CPU variables. Such support becomes necessary as more statically allocated per-CPU data are added to the kernel.
2014-09-03x86/cpu: move cpu_load_gdt() to the init sectionRichard Braun
2014-08-20x86/{acpimp,cpu}: fix error handlingRichard Braun
Commit bc7c779bc15d6a47b785478fa1fd9505662761a9 removed support for legacy multiprocessor specification, but also messed up error handling on ACPI MP setup failure, leading to a situation where the system would start with one processor but without a local APIC. In addition, fix handling of buggy BIOSes exporting the same tables multiple times.
2014-06-19x86/cpu: unconditionnally call pmap_mp_setupRichard Braun
2014-06-10kern/llsync: rework lockless synchronizationRichard Braun
Use a global checkpoint identifier as a generation counter and remove reset interrupts. For some reason I can't remember, using reset interrupts was thought to be more efficient, perhaps because accessing a global variable on each checkpoint looked expensive. But it's really not scalable, and a read-mostly global variable can get cached locally and not incur expensive access. In addition, add a decent amount of documentation about the semantics with regard to the rest of the system. Explicitely state that checkpoints are triggered by context switches and that it's not allowed to block inside read-side critical sections. Make periodic events attempt to trigger checkpoints too. Add a thread-local read-side critical section nesting counter so that it can be reliably determined whether the processor is running a read-side critical section or not.
2014-05-28x86/{boot,cpu}: dynamically allocate AP boot stacksRichard Braun
The main goal of this change is to reduce the size of the kernel executable image since boot stacks, despite being uninitialized, aren't declared as common symbols.
2014-05-21x86/cpu: fix lapic module usage when sending IPIsRichard Braun