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

Changeset f5dd4a1 in mainline


Ignore:
Timestamp:
2019-03-31T16:44:21Z (22 months ago)
Author:
Jakub Jermar <jakub@…>
Branches:
master
Children:
f27e21d
Parents:
68d8736
Message:

Move most of msim-specific stuff under mach/msim

Location:
kernel/arch/mips32
Files:
1 deleted
6 edited
2 moved

Legend:

Unmodified
Added
Removed
  • kernel/arch/mips32/Makefile.inc

    r68d8736 rf5dd4a1  
    7070        arch/$(KARCH)/src/machine_func.c
    7171
    72 ifeq ($(MACHINE),msim)
    73         ARCH_SOURCES += \
    74                 arch/$(KARCH)/src/smp/dorder.c
    75 endif
    76 
    7772ifeq ($(MACHINE),$(filter lmalta bmalta,$(MACHINE)))
    7873        ARCH_SOURCES += arch/$(KARCH)/src/mach/malta/malta.c
     
    8075
    8176ifeq ($(MACHINE),msim)
    82         ARCH_SOURCES += arch/$(KARCH)/src/mach/msim/msim.c
     77        ARCH_SOURCES += \
     78                arch/$(KARCH)/src/mach/msim/msim.c \
     79                arch/$(KARCH)/src/mach/msim/dorder.c
    8380endif
    8481
  • kernel/arch/mips32/include/arch/mach/msim/dorder.h

    r68d8736 rf5dd4a1  
    3838#include <stdint.h>
    3939
     40extern void dorder_init(void);
    4041extern uint32_t dorder_cpuid(void);
    4142extern void dorder_ipi_ack(uint32_t);
  • kernel/arch/mips32/include/arch/mach/msim/msim.h

    r68d8736 rf5dd4a1  
    3838
    3939#include <arch/machine_func.h>
     40#include <arch/mm/page.h>
     41
     42/** Address of devices. */
     43#define MSIM_VIDEORAM        PA2KSEG1(0x10000000)
     44#define MSIM_KBD_ADDRESS     PA2KSEG1(0x10000000)
     45#define MSIM_DORDER_ADDRESS  PA2KSEG1(0x10000100)
     46
     47#define MSIM_KBD_IRQ      2
     48#define MSIM_DORDER_IRQ   5
     49#define MSIM_DDISK_IRQ    6
    4050
    4151extern struct mips32_machine_ops msim_machine_ops;
  • kernel/arch/mips32/include/arch/mm/page.h

    r68d8736 rf5dd4a1  
    4343
    4444#ifndef __ASSEMBLER__
     45#       define KSEG12PA(x)      (((uintptr_t) (x)) - 0xa0000000)
    4546#       define PA2KSEG1(x)      (((uintptr_t) (x)) + 0xa0000000)
    4647#       define KA2PA(x) (((uintptr_t) (x)) - 0x80000000)
  • kernel/arch/mips32/src/interrupt.c

    r68d8736 rf5dd4a1  
    3838#include <arch.h>
    3939#include <arch/cp0.h>
    40 #include <arch/smp/dorder.h>
    4140#include <time/clock.h>
    4241#include <ipc/sysipc.h>
     
    4544#define TIMER_IRQ   7
    4645
    47 #ifdef MACHINE_msim
    48 #define DORDER_IRQ  5
    49 #endif
    50 
    5146function virtual_timer_fnc = NULL;
    5247static irq_t timer_irq;
    53 
    54 #ifdef MACHINE_msim
    55 static irq_t dorder_irq;
    56 #endif
    5748
    5849// TODO: This is SMP unsafe!!!
     
    156147}
    157148
    158 #ifdef MACHINE_msim
    159 static irq_ownership_t dorder_claim(irq_t *irq)
    160 {
    161         return IRQ_ACCEPT;
    162 }
    163 
    164 static void dorder_irq_handler(irq_t *irq)
    165 {
    166         dorder_ipi_ack(1 << dorder_cpuid());
    167 }
    168 #endif
    169 
    170149/* Initialize basic tables for exception dispatching */
    171150void interrupt_init(void)
     
    181160        timer_start();
    182161        cp0_unmask_int(TIMER_IRQ);
    183 
    184 #ifdef MACHINE_msim
    185         irq_initialize(&dorder_irq);
    186         dorder_irq.inr = DORDER_IRQ;
    187         dorder_irq.claim = dorder_claim;
    188         dorder_irq.handler = dorder_irq_handler;
    189         irq_register(&dorder_irq);
    190 
    191         cp0_unmask_int(DORDER_IRQ);
    192 #endif
    193162}
    194163
  • kernel/arch/mips32/src/mach/msim/dorder.c

    r68d8736 rf5dd4a1  
    3333 */
    3434
     35#include <arch/mach/msim/dorder.h>
     36#include <arch/mach/msim/msim.h>
    3537#include <stdint.h>
    3638#include <smp/ipi.h>
    37 #include <arch/smp/dorder.h>
     39#include <interrupt.h>
    3840
    39 #define MSIM_DORDER_ADDRESS  0xB0000100
     41static irq_t dorder_irq;
    4042
    4143#ifdef CONFIG_SMP
     
    4749
    4850#endif
     51
     52static irq_ownership_t dorder_claim(irq_t *irq)
     53{
     54        return IRQ_ACCEPT;
     55}
     56
     57static void dorder_irq_handler(irq_t *irq)
     58{
     59        dorder_ipi_ack(1 << dorder_cpuid());
     60}
     61
     62void dorder_init(void)
     63{
     64        irq_initialize(&dorder_irq);
     65        dorder_irq.inr = MSIM_DORDER_IRQ;
     66        dorder_irq.claim = dorder_claim;
     67        dorder_irq.handler = dorder_irq_handler;
     68        irq_register(&dorder_irq);
     69
     70        cp0_unmask_int(MSIM_DORDER_IRQ);
     71}
    4972
    5073uint32_t dorder_cpuid(void)
  • kernel/arch/mips32/src/mach/msim/msim.c

    r68d8736 rf5dd4a1  
    3535
    3636#include <arch/mach/msim/msim.h>
     37#include <arch/mach/msim/dorder.h>
    3738#include <console/console.h>
    3839#include <sysinfo/sysinfo.h>
    39 #include <arch/drivers/msim.h>
    4040#include <genarch/drivers/dsrln/dsrlnin.h>
    4141#include <genarch/drivers/dsrln/dsrlnout.h>
     
    6262void msim_init(void)
    6363{
     64        dorder_init();
    6465        cp0_unmask_int(MSIM_DDISK_IRQ);
    6566}
  • kernel/arch/mips32/src/mm/frame.c

    r68d8736 rf5dd4a1  
    4141#include <config.h>
    4242#ifdef MACHINE_msim
    43 #include <arch/drivers/msim.h>
     43#include <arch/mach/msim/msim.h>
    4444#endif
    4545#include <arch/arch.h>
     
    5757
    5858#define ZERO_PAGE_VALUE_KSEG1(frame) \
    59         (((volatile uint32_t *) (0xa0000000 + (frame << ZERO_PAGE_WIDTH)))[ZERO_PAGE_OFFSET])
     59        (((volatile uint32_t *) PA2KSEG1(frame << ZERO_PAGE_WIDTH))[ZERO_PAGE_OFFSET])
    6060
    6161#define MAX_REGIONS  32
     
    8080#ifdef MACHINE_msim
    8181        /* MSIM device (dprinter) */
    82         if (frame == (KA2PA(MSIM_VIDEORAM) >> ZERO_PAGE_WIDTH))
     82        if (frame == (KSEG12PA(MSIM_VIDEORAM) >> ZERO_PAGE_WIDTH))
    8383                return false;
    8484
    8585        /* MSIM device (dkeyboard) */
    86         if (frame == (KA2PA(MSIM_KBD_ADDRESS) >> ZERO_PAGE_WIDTH))
     86        if (frame == (KSEG12PA(MSIM_KBD_ADDRESS) >> ZERO_PAGE_WIDTH))
    8787                return false;
    8888#endif
Note: See TracChangeset for help on using the changeset viewer.