Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/arm32/src/mach/testarm/testarm.c

    ra71c158 reff1f033  
    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,
    6161        gxemul_cpu_halt,
    62         gxemul_get_memory_size,
     62        gxemul_get_memory_extents,
    6363        gxemul_irq_exception,
    6464        gxemul_frame_init,
    6565        gxemul_output_init,
    66         gxemul_input_init
     66        gxemul_input_init,
     67        gxemul_get_irq_count,
     68        gxemul_get_platform_name
    6769};
    6870
     
    122124        sysinfo_set_item_val("kbd", NULL, true);
    123125        sysinfo_set_item_val("kbd.inr", NULL, GXEMUL_KBD_IRQ);
    124         sysinfo_set_item_val("kbd.address.virtual", NULL, (unative_t) gxemul_kbd);
     126        sysinfo_set_item_val("kbd.address.virtual", NULL, (sysarg_t) gxemul_kbd);
    125127#endif
     128}
     129
     130size_t gxemul_get_irq_count(void)
     131{
     132        return GXEMUL_IRQ_COUNT;
     133}
     134
     135const char *gxemul_get_platform_name(void)
     136{
     137        return "gxemul";
    126138}
    127139
     
    185197}
    186198
    187 /** Returns the size of emulated memory.
    188  *
    189  * @return Size in bytes.
    190  */
    191 uintptr_t gxemul_get_memory_size(void)
    192 {
    193         return  *((uintptr_t *) (GXEMUL_MP_ADDRESS + GXEMUL_MP_MEMSIZE_OFFSET));
    194 }
    195 
     199/** Get extents of available memory.
     200 *
     201 * @param start         Place to store memory start address.
     202 * @param size          Place to store memory size.
     203 */
     204void gxemul_get_memory_extents(uintptr_t *start, uintptr_t *size)
     205{
     206        *start = 0;
     207        *size = *((uintptr_t *) (GXEMUL_MP_ADDRESS + GXEMUL_MP_MEMSIZE_OFFSET));
     208}
    196209
    197210/** Returns the mask of active interrupts. */
     
    205218 * Determines the sources of interrupt and calls their handlers.
    206219 */
    207 void gxemul_irq_exception(int exc_no, istate_t *istate)
     220void gxemul_irq_exception(unsigned int exc_no, istate_t *istate)
    208221{
    209222        uint32_t sources = gxemul_irqc_get_sources();
    210223        unsigned int i;
    211224
    212         for (i = 0; i < GXEMUL_IRQC_MAX_IRQ; i++) {
     225        for (i = 0; i < GXEMUL_IRQ_COUNT; i++) {
    213226                if (sources & (1 << i)) {
    214227                        irq_t *irq = irq_dispatch_and_lock(i);
Note: See TracChangeset for help on using the changeset viewer.