Changeset a71c158 in mainline for kernel/arch/arm32


Ignore:
Timestamp:
2009-08-21T14:12:45Z (16 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
0e6dce8, b50b5af2, e5792d1
Parents:
90c8b8d
Message:

kernel output devices now suport multiple instances (except ski and sgcn, which respect the same interface, but behave as singletons)
if more than one output device gets initialized, the output is cloned to all of them
get rid of arch_grab_console() and arch_release_console() (output devices can implement a generic "redraw" method, input devices respect the "silent" global variable)
related cleanups and modifications

Location:
kernel/arch/arm32
Files:
7 edited

Legend:

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

    r90c8b8d ra71c158  
    9898
    9999extern void icp_init(void);
    100 extern void icp_fb_init(void);
    101100extern void icp_output_init(void);
    102101extern void icp_input_init(void);
    103 extern void icp_release_console(void);
    104 extern void icp_grab_console(void);
    105102extern void icp_timer_irq_start(void);
    106103extern void icp_cpu_halt(void);
    107104extern void icp_irq_exception(int exc_no, istate_t *istate);
    108105extern uintptr_t icp_get_memory_size(void);
    109 extern uintptr_t icp_get_fb_address(void);
    110 extern void icp_fb_init(void);
    111106extern void icp_frame_init(void);
    112107
  • kernel/arch/arm32/include/mach/testarm/testarm.h

    r90c8b8d ra71c158  
    6868
    6969extern void gxemul_init(void);
    70 extern void gxemul_fb_init(void);
    7170extern void gxemul_output_init(void);
    7271extern void gxemul_input_init(void);
    73 extern void gxemul_release_console(void);
    74 extern void gxemul_grab_console(void);
    7572extern void gxemul_timer_irq_start(void);
    7673extern void gxemul_cpu_halt(void);
    7774extern void gxemul_irq_exception(int exc_no, istate_t *istate);
    7875extern uintptr_t gxemul_get_memory_size(void);
    79 extern uintptr_t gxemul_get_fb_address(void);
    80 extern void gxemul_fb_init(void);
    8176extern void gxemul_frame_init(void);
    8277
  • kernel/arch/arm32/include/machine_func.h

    r90c8b8d ra71c158  
    4949
    5050struct arm_machine_ops {
    51         void            (*machine_grab_console)(void);
    52         void            (*machine_release_console)(void);
    5351        void            (*machine_init)(void);
    5452        void            (*machine_timer_irq_start)(void);
    5553        void            (*machine_cpu_halt)(void);
    5654        uintptr_t       (*machine_get_memory_size)(void);
    57         void            (*machine_fb_init)(void);
    5855        void            (*machine_irq_exception)(int, istate_t*);
    59         uintptr_t       (*machine_get_fb_address)(void);
    6056        void            (*machine_frame_init)(void);
    6157        void            (*machine_output_init)(void);
     
    6460
    6561extern struct arm_machine_ops machine_ops;
    66 
    67 
    68 /** Acquire console back for kernel. */
    69 extern void machine_grab_console(void);
    70 
    71 /** Return console to userspace. */
    72 extern void machine_release_console(void);
    7362
    7463
     
    9180extern uintptr_t machine_get_memory_size(void);
    9281
    93 /** Initializes the Frame Buffer
    94  *
    95  */
    96 extern void machine_fb_init(void);
    97 
    9882
    9983/** Interrupt exception handler.
     
    10488extern void machine_irq_exception(int exc_no, istate_t *istate);
    10589
    106 
    107 /** Returns address of framebuffer device.
    108  *
    109  *  @return Address of framebuffer device.
    110  */
    111 extern uintptr_t machine_get_fb_address(void);
    11290
    11391/*
  • kernel/arch/arm32/src/arm32.c

    r90c8b8d ra71c158  
    8989        interrupt_init();
    9090       
    91 #ifdef CONFIG_FB
    92         machine_fb_init();
    93 #else
    94 #ifdef CONFIG_ARM_PRN
    9591        machine_output_init();
    96 #endif /* CONFIG_ARM_PRN */
    97 #endif /* CONFIG_FB */
    9892}
    9993
     
    182176}
    183177
    184 /** Acquire console back for kernel. */
    185 void arch_grab_console(void)
    186 {
    187         machine_grab_console();
    188 #ifdef CONFIG_FB
    189         fb_redraw();
    190 #endif
    191 }
    192 
    193 /** Return console to userspace. */
    194 void arch_release_console(void)
    195 {
    196         machine_release_console();
    197 }
    198 
    199178/** @}
    200179 */
  • kernel/arch/arm32/src/mach/integratorcp/integratorcp.c

    r90c8b8d ra71c158  
    5757static irq_t icp_timer_irq;
    5858struct arm_machine_ops machine_ops = {
    59         MACHINE_GENFUNC,
    60         MACHINE_GENFUNC,
    6159        icp_init,
    6260        icp_timer_irq_start,
    6361        icp_cpu_halt,
    6462        icp_get_memory_size,
    65         icp_fb_init,
    6663        icp_irq_exception,
    67         icp_get_fb_address,
    6864        icp_frame_init,
    6965        icp_output_init,
     
    128124}
    129125
    130 /** Initializes the icp frame buffer */
    131 void icp_fb_init(void)
    132 {
    133         fb_properties_t prop = {
    134                 .addr = 0,
    135                 .offset = 0,
    136                 .x = 640,
    137                 .y = 480,
    138                 .scan = 2560,
    139                 .visual = VISUAL_BGR_0_8_8_8,
    140         };
    141         prop.addr = icp_get_fb_address();
    142         fb_init(&prop);
    143         fb_parea.pbase = ICP_FB;
    144         fb_parea.frames = 300;
    145         ddi_parea_register(&fb_parea);
    146 }
    147 
    148126/** Initializes icp_hw_map. */
    149127void icp_init(void)
     
    172150}
    173151
    174 
    175 /** Acquire console back for kernel. */
    176 void icp_grab_console(void)
    177 {
    178 }
    179 
    180 /** Return console to userspace. */
    181 void icp_release_console(void)
    182 {
    183 }
    184 
    185152/** Starts icp Real Time Clock device, which asserts regular interrupts.
    186  * 
     153 *
    187154 * @param frequency Interrupts frequency (0 disables RTC).
    188155 */
     
    296263}
    297264
    298 /** Returns address of framebuffer device.
    299  *
    300  *  @return Address of framebuffer device.
    301  */
    302 uintptr_t icp_get_fb_address(void)
    303 {
     265/*
     266 * Integrator specific frame initialization
     267 */
     268void
     269icp_frame_init(void)
     270{
     271        frame_mark_unavailable(ICP_FB_FRAME, ICP_FB_NUM_FRAME);
     272        frame_mark_unavailable(0, 256);
     273}
     274
     275void icp_output_init(void)
     276{
     277#ifdef CONFIG_FB
    304278        if (!vga_init) {
    305279                icp_vga_init();
    306280                vga_init = true;
    307281        }
    308         return (uintptr_t) ICP_FB;
    309 }
    310 
    311 /*
    312  * Integrator specific frame initialization
    313  */
    314 void
    315 icp_frame_init(void)
    316 {
    317         frame_mark_unavailable(ICP_FB_FRAME, ICP_FB_NUM_FRAME);
    318         frame_mark_unavailable(0, 256);
    319 }
    320 
    321 void icp_output_init(void)
    322 {
     282       
     283        fb_properties_t prop = {
     284                .addr = ICP_FB,
     285                .offset = 0,
     286                .x = 640,
     287                .y = 480,
     288                .scan = 2560,
     289                .visual = VISUAL_BGR_0_8_8_8,
     290        };
     291       
     292        outdev_t *fbdev = fb_init(&prop);
     293        if (fbdev) {
     294                stdout_wire(fbdev);
     295                fb_parea.pbase = ICP_FB;
     296                fb_parea.frames = 300;
     297                ddi_parea_register(&fb_parea);
     298        }
     299#endif
    323300}
    324301
  • kernel/arch/arm32/src/mach/testarm/testarm.c

    r90c8b8d ra71c158  
    5757
    5858struct arm_machine_ops machine_ops = {
    59         MACHINE_GENFUNC,
    60         MACHINE_GENFUNC,
    6159        gxemul_init,
    6260        gxemul_timer_irq_start,
    6361        gxemul_cpu_halt,
    6462        gxemul_get_memory_size,
    65         gxemul_fb_init,
    6663        gxemul_irq_exception,
    67         gxemul_get_fb_address,
    6864        gxemul_frame_init,
    6965        gxemul_output_init,
     
    7874}
    7975
    80 void gxemul_fb_init(void)
    81 {
     76void gxemul_output_init(void)
     77{
     78#ifdef CONFIG_FB
    8279        fb_properties_t prop = {
    8380                .addr = GXEMUL_FB_ADDRESS,
     
    8885                .visual = VISUAL_RGB_8_8_8,
    8986        };
    90         fb_init(&prop);
    91 }
    92 
    93 void gxemul_output_init(void)
    94 {
    95         dsrlnout_init((ioport8_t *) gxemul_kbd);
     87       
     88        outdev_t *fbdev = fb_init(&prop);
     89        if (fbdev)
     90                stdout_wire(fbdev);
     91#endif
     92       
     93#ifdef CONFIG_ARM_PRN
     94        outdev_t *dsrlndev = dsrlnout_init((ioport8_t *) gxemul_kbd);
     95        if (dsrlndev)
     96                stdout_wire(dsrlndev);
     97#endif
    9698}
    9799
     
    233235}
    234236
    235 uintptr_t gxemul_get_fb_address()
    236 {
    237         return ((uintptr_t)GXEMUL_FB_ADDRESS);
    238 }
    239 
    240 
    241237/** @}
    242238 */
  • kernel/arch/arm32/src/machine_func.c

    r90c8b8d ra71c158  
    4141
    4242
    43 /** Acquire console back for kernel. */
    44 void machine_grab_console(void)
    45 {
    46         (machine_ops.machine_grab_console)();
    47 }
    48 
    49 /** Return console to userspace. */
    50 void machine_release_console(void)
    51 {
    52         (machine_ops.machine_release_console)();
    53 }
    54 
    55 
    5643/** Maps HW devices to the kernel address space using #hw_map. */
    5744void machine_init(void)
     
    8471}
    8572
    86 /** Initializes the Frame Buffer
    87  *
    88  */
    89 void machine_fb_init(void)
    90 {
    91         (machine_ops.machine_fb_init)();
    92 }
    93 
    94 
    9573/** Interrupt exception handler.
    9674 *
     
    10381}
    10482
    105 
    106 /** Returns address of framebuffer device.
    107  *
    108  *  @return Address of framebuffer device.
    109  */
    110 uintptr_t machine_get_fb_address(void)
    111 {
    112         return (machine_ops.machine_get_fb_address)();
    113 }
    11483
    11584/*
Note: See TracChangeset for help on using the changeset viewer.