Fork us on GitHub Follow us on Facebook Follow us on Twitter

Changeset 66fcba2 in mainline


Ignore:
Timestamp:
2010-06-20T15:35:39Z (11 years ago)
Author:
Jiri Svoboda <jiri@…>
Branches:
lfn, master
Children:
6b80696, 7c866dc
Parents:
5ac77cc
Message:

Do not decide which machine_ops to use at link time.

Location:
kernel/arch/arm32
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/arm32/include/mach/integratorcp/integratorcp.h

    r5ac77cc r66fcba2  
    3636 */
    3737
    38 #ifndef KERN_arm32_MACHINE_H_
    39 #define KERN_arm32_MACHINE_H_
     38#ifndef KERN_arm32_icp_H_
     39#define KERN_arm32_icp_H_
    4040
    4141#include <arch/machine_func.h>
     
    106106extern void icp_frame_init(void);
    107107
     108extern struct arm_machine_ops icp_machine_ops;
     109
    108110#endif
    109111
  • kernel/arch/arm32/include/mach/testarm/testarm.h

    r5ac77cc r66fcba2  
    3737 */
    3838
    39 #ifndef KERN_arm32_MACHINE_H_
    40 #define KERN_arm32_MACHINE_H_
     39#ifndef KERN_arm32_testarm_H_
     40#define KERN_arm32_testarm_H_
    4141
    4242#include <arch/machine_func.h>
     
    7676extern void gxemul_frame_init(void);
    7777
     78extern struct arm_machine_ops gxemul_machine_ops;
    7879
    7980#endif
  • kernel/arch/arm32/include/machine_func.h

    r5ac77cc r66fcba2  
    5757};
    5858
    59 extern struct arm_machine_ops machine_ops;
     59/** Pointer to arm_machine_ops structure being used. */
     60extern struct arm_machine_ops *machine_ops;
    6061
     62/** Initialize machine_ops pointer. */
     63extern void machine_ops_init(void);
    6164
    6265/** Maps HW devices to the kernel address space using #hw_map. */
  • kernel/arch/arm32/src/arm32.c

    r5ac77cc r66fcba2  
    6363                    bootinfo->tasks[i].name);
    6464        }
     65
     66        /* Initialize machine_ops pointer. */
     67        machine_ops_init();
    6568}
    6669
  • kernel/arch/arm32/src/mach/integratorcp/integratorcp.c

    r5ac77cc r66fcba2  
    5656static icp_hw_map_t icp_hw_map;
    5757static irq_t icp_timer_irq;
    58 struct arm_machine_ops machine_ops = {
     58struct arm_machine_ops icp_machine_ops = {
    5959        icp_init,
    6060        icp_timer_irq_start,
  • kernel/arch/arm32/src/mach/testarm/testarm.c

    r5ac77cc r66fcba2  
    5656static irq_t gxemul_timer_irq;
    5757
    58 struct arm_machine_ops machine_ops = {
     58struct arm_machine_ops gxemul_machine_ops = {
    5959        gxemul_init,
    6060        gxemul_timer_irq_start,
  • kernel/arch/arm32/src/machine_func.c

    r5ac77cc r66fcba2  
    3939
    4040#include <arch/machine_func.h>
     41#include <arch/mach/integratorcp/integratorcp.h>
     42#include <arch/mach/testarm/testarm.h>
    4143
     44/** Pointer to machine_ops structure being used. */
     45struct arm_machine_ops *machine_ops;
     46
     47/** Initialize machine_ops pointer. */
     48void machine_ops_init(void)
     49{
     50#if defined(MACHINE_testarm)
     51        machine_ops = &gxemul_machine_ops;
     52#elif defined(MACHINE_integratorcp)
     53        machine_ops = &icp_machine_ops;
     54#else
     55#error Machine type not defined.
     56#endif
     57}
    4258
    4359/** Maps HW devices to the kernel address space using #hw_map. */
    4460void machine_init(void)
    4561{
    46         (machine_ops.machine_init)();
     62        (machine_ops->machine_init)();
    4763}
    4864
     
    5167void machine_timer_irq_start(void)
    5268{
    53         (machine_ops.machine_timer_irq_start)();
     69        (machine_ops->machine_timer_irq_start)();
    5470}
    5571
     
    5874void machine_cpu_halt(void)
    5975{
    60         (machine_ops.machine_cpu_halt)();
     76        (machine_ops->machine_cpu_halt)();
    6177}
    6278
     
    6884uintptr_t machine_get_memory_size(void)
    6985{
    70         return (machine_ops.machine_get_memory_size)();
     86        return (machine_ops->machine_get_memory_size)();
    7187}
    7288
     
    7894void machine_irq_exception(unsigned int exc_no, istate_t *istate)
    7995{
    80         (machine_ops.machine_irq_exception)(exc_no, istate);
     96        (machine_ops->machine_irq_exception)(exc_no, istate);
    8197}
    8298
     
    87103void machine_frame_init(void)
    88104{
    89         (machine_ops.machine_frame_init)();
     105        (machine_ops->machine_frame_init)();
    90106}
    91107
     
    95111void machine_output_init(void)
    96112{
    97         (machine_ops.machine_output_init)();
     113        (machine_ops->machine_output_init)();
    98114}
    99115
     
    103119void machine_input_init(void)
    104120{
    105         (machine_ops.machine_input_init)();
     121        (machine_ops->machine_input_init)();
    106122}
    107123
Note: See TracChangeset for help on using the changeset viewer.