Changeset 2ee1ccc in mainline


Ignore:
Timestamp:
2012-07-01T05:18:27Z (12 years ago)
Author:
Adam Hraska <adam.hraska+hos@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
d71331b
Parents:
49e6c6b4
Message:

smp_call: initial unicast version for ia32, amd64.

Location:
kernel
Files:
5 added
10 edited

Legend:

Unmodified
Added
Removed
  • kernel/Makefile

    r49e6c6b4 r2ee1ccc  
    255255        generic/src/smp/ipi.c \
    256256        generic/src/smp/smp.c \
     257        generic/src/smp/smp_call.c \
    257258        generic/src/ipc/ipc.c \
    258259        generic/src/ipc/sysipc.c \
  • kernel/arch/amd64/Makefile.inc

    r49e6c6b4 r2ee1ccc  
    104104                arch/$(KARCH)/src/smp/ipi.c \
    105105                arch/$(KARCH)/src/smp/mps.c \
     106                arch/$(KARCH)/src/smp/smp_call.c \
    106107                arch/$(KARCH)/src/smp/smp.c
    107108endif
  • kernel/arch/amd64/include/interrupt.h

    r49e6c6b4 r2ee1ccc  
    6969#define VECTOR_TLB_SHOOTDOWN_IPI  (IVT_FREEBASE + 1)
    7070#define VECTOR_DEBUG_IPI          (IVT_FREEBASE + 2)
     71#define VECTOR_SMP_CALL_IPI       (IVT_FREEBASE + 3)
    7172
    7273extern void (* disable_irqs_function)(uint16_t);
  • kernel/arch/amd64/src/interrupt.c

    r49e6c6b4 r2ee1ccc  
    5454#include <symtab.h>
    5555#include <stacktrace.h>
     56#include <smp/smp_call.h>
    5657
    5758/*
     
    161162        tlb_shootdown_ipi_recv();
    162163}
     164
     165static void arch_smp_call_ipi_recv(unsigned int n, istate_t *istate)
     166{
     167        trap_virtual_eoi();
     168        smp_call_ipi_recv();
     169}
    163170#endif
    164171
     
    222229        exc_register(VECTOR_TLB_SHOOTDOWN_IPI, "tlb_shootdown", true,
    223230            (iroutine_t) tlb_shootdown_ipi);
     231        exc_register(VECTOR_SMP_CALL_IPI, "smp_call", true,
     232                (iroutine_t) arch_smp_call_ipi_recv);
    224233#endif
    225234}
  • kernel/arch/ia32/Makefile.inc

    r49e6c6b4 r2ee1ccc  
    8686        arch/$(KARCH)/src/smp/mps.c \
    8787        arch/$(KARCH)/src/smp/smp.c \
     88        arch/$(KARCH)/src/smp/smp_call.c \
    8889        arch/$(KARCH)/src/atomic.S \
    8990        arch/$(KARCH)/src/smp/ipi.c \
  • kernel/arch/ia32/include/interrupt.h

    r49e6c6b4 r2ee1ccc  
    6969#define VECTOR_TLB_SHOOTDOWN_IPI  (IVT_FREEBASE + 1)
    7070#define VECTOR_DEBUG_IPI          (IVT_FREEBASE + 2)
     71#define VECTOR_SMP_CALL_IPI       (IVT_FREEBASE + 3)
    7172
    7273extern void (* disable_irqs_function)(uint16_t);
  • kernel/arch/ia32/src/interrupt.c

    r49e6c6b4 r2ee1ccc  
    5454#include <symtab.h>
    5555#include <stacktrace.h>
     56#include <smp/smp_call.h>
    5657
    5758/*
     
    170171        tlb_shootdown_ipi_recv();
    171172}
     173
     174static void arch_smp_call_ipi_recv(unsigned int n, istate_t *istate)
     175{
     176        trap_virtual_eoi();
     177        smp_call_ipi_recv();
     178}
    172179#endif
    173180
     
    230237        exc_register(VECTOR_TLB_SHOOTDOWN_IPI, "tlb_shootdown", true,
    231238            (iroutine_t) tlb_shootdown_ipi);
     239        exc_register(VECTOR_SMP_CALL_IPI, "smp_call", true,
     240            (iroutine_t) arch_smp_call_ipi_recv);
    232241#endif
    233242}
  • kernel/generic/include/adt/list.h

    r49e6c6b4 r2ee1ccc  
    258258}
    259259
     260/** Moves items of one list into another after the specified item.
     261 *
     262 * Inserts all items of @a list after item at @a pos in another list.
     263 * Both lists may be empty.
     264 *
     265 * In order to insert the list at the beginning of another list, use:
     266 * @code
     267 * list_splice(&list_dest.head, &list_src);
     268 * @endcode
     269 *
     270 * @param list Source list to move after pos.
     271 * @param pos Source items will be placed after this item.
     272 */
     273NO_TRACE static inline void list_splice(list_t *list, link_t *pos)
     274{
     275        link_t *pos_next = pos->next;
     276       
     277        if (!list_empty(list)) {
     278                link_t *first = list->head.next;
     279                link_t *last = list->head.prev;
     280
     281                pos->next = first;
     282                first->prev = pos;
     283
     284                last->next = pos_next;
     285                pos_next->prev = last;
     286               
     287                list_initialize(list);
     288        }
     289}
     290
    260291/** Get n-th item in a list.
    261292 *
  • kernel/generic/include/cpu.h

    r49e6c6b4 r2ee1ccc  
    9494       
    9595        /**
     96         * SMP calls to invoke on this CPU.
     97         */
     98        SPINLOCK_DECLARE(smp_calls_lock);
     99        list_t smp_pending_calls;
     100       
     101        /**
    96102         * Stack used by scheduler when there is no running thread.
    97103         */
  • kernel/generic/src/main/main.c

    r49e6c6b4 r2ee1ccc  
    7575#include <synch/waitq.h>
    7676#include <synch/futex.h>
     77#include <smp/smp_call.h>
    7778#include <arch/arch.h>
    7879#include <arch.h>
     
    247248        arch_post_cpu_init();
    248249
     250        smp_call_init();
    249251        clock_counter_init();
    250252        timeout_init();
     
    348350void main_ap_separated_stack(void)
    349351{
     352        smp_call_init();
     353       
    350354        /*
    351355         * Configure timeouts for this cpu.
Note: See TracChangeset for help on using the changeset viewer.