Changeset 36df4109 in mainline for kernel/arch/amd64/src/amd64.c


Ignore:
Timestamp:
2016-06-06T16:29:56Z (8 years ago)
Author:
Jakub Jermar <jakub@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
7510326
Parents:
7f0580d
Message:

Introduce architecure-specific operations

This replaces the arch_*_init() functions with an arch_ops_t structure
defined for each architecture. Undefined operations are treated as NOPs.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/amd64/src/amd64.c

    r7f0580d r36df4109  
    3434
    3535#include <arch.h>
     36#include <arch/arch.h>
    3637#include <typedefs.h>
    3738#include <errno.h>
     
    6465#endif
    6566
     67static void amd64_pre_mm_init(void);
     68static void amd64_post_mm_init(void);
     69static void amd64_post_cpu_init(void);
     70static void amd64_pre_smp_init(void);
     71static void amd64_post_smp_init(void);
     72
     73arch_ops_t amd64_ops = {
     74        .pre_mm_init = amd64_pre_mm_init,
     75        .post_mm_init = amd64_post_mm_init,
     76        .post_cpu_init = amd64_post_cpu_init,
     77        .pre_smp_init = amd64_pre_smp_init,
     78        .post_smp_init = amd64_post_smp_init
     79};
     80
     81arch_ops_t *arch_ops = &amd64_ops;
     82
    6683/** Perform amd64-specific initialization before main_bsp() is called.
    6784 *
     
    7087 *
    7188 */
    72 void arch_pre_main(uint32_t signature, void *info)
     89void amd64_pre_main(uint32_t signature, void *info)
    7390{
    7491        /* Parse multiboot information obtained from the bootloader. */
     
    83100}
    84101
    85 void arch_pre_mm_init(void)
     102void amd64_pre_mm_init(void)
    86103{
    87104        /* Enable no-execute pages */
     
    107124}
    108125
    109 
    110 void arch_post_mm_init(void)
     126void amd64_post_mm_init(void)
    111127{
    112128        vreg_init();
     
    144160}
    145161
    146 void arch_post_cpu_init(void)
     162void amd64_post_cpu_init(void)
    147163{
    148164#ifdef CONFIG_SMP
     
    154170}
    155171
    156 void arch_pre_smp_init(void)
     172void amd64_pre_smp_init(void)
    157173{
    158174        if (config.cpu_active == 1) {
     
    163179}
    164180
    165 void arch_post_smp_init(void)
     181void amd64_post_smp_init(void)
    166182{
    167183        /* Currently the only supported platform for amd64 is 'pc'. */
Note: See TracChangeset for help on using the changeset viewer.