Changeset 5b23a82 in mainline for kernel/arch/xen32/include/asm.h


Ignore:
Timestamp:
2006-08-01T21:12:54Z (19 years ago)
Author:
Martin Decky <martin@…>
Branches:
lfn, master, serial, ticket/834-toolchain-update, topic/msim-upgrade, topic/simplify-dev-export
Children:
7c5a8dd
Parents:
7d3d641
Message:

xen32: enable/disable interrupts

File:
1 edited

Legend:

Unmodified
Added
Removed
  • kernel/arch/xen32/include/asm.h

    r7d3d641 r5b23a82  
    3939#include <arch/pm.h>
    4040#include <arch/types.h>
     41#include <arch/barrier.h>
    4142#include <config.h>
    4243
     
    151152static inline ipl_t interrupts_enable(void)
    152153{
    153         ipl_t v = 0;
    154 /*      __asm__ volatile (
    155                 "pushf\n\t"
    156                 "popl %0\n\t"
    157                 "sti\n"
    158                 : "=r" (v)
    159         );*/
     154        // FIXME SMP
     155       
     156        ipl_t v = shared_info.vcpu_info[0].evtchn_upcall_mask;
     157        write_barrier();
     158        shared_info.vcpu_info[0].evtchn_upcall_mask = 0;
     159        write_barrier();
     160        if (shared_info.vcpu_info[0].evtchn_upcall_pending)
     161                force_evtchn_callback();
     162       
    160163        return v;
    161164}
     
    170173static inline ipl_t interrupts_disable(void)
    171174{
    172         ipl_t v = 0;
    173 /*      __asm__ volatile (
    174                 "pushf\n\t"
    175                 "popl %0\n\t"
    176                 "cli\n"
    177                 : "=r" (v)
    178         );*/
     175        // FIXME SMP
     176       
     177        ipl_t v = shared_info.vcpu_info[0].evtchn_upcall_mask;
     178        shared_info.vcpu_info[0].evtchn_upcall_mask = 1;
     179        write_barrier();
     180       
    179181        return v;
    180182}
     
    188190static inline void interrupts_restore(ipl_t ipl)
    189191{
    190 /*      __asm__ volatile (
    191                 "pushl %0\n\t"
    192                 "popf\n"
    193                 : : "r" (ipl)
    194         );*/
     192        if (ipl == 0)
     193                interrupts_enable();
     194        else
     195                interrupts_disable();
    195196}
    196197
     
    201202static inline ipl_t interrupts_read(void)
    202203{
    203         ipl_t v = 0;
    204 /*      __asm__ volatile (
    205                 "pushf\n\t"
    206                 "popl %0\n"
    207                 : "=r" (v)
    208         );*/
    209         return v;
     204        // FIXME SMP
     205       
     206        return shared_info.vcpu_info[0].evtchn_upcall_mask;
    210207}
    211208
Note: See TracChangeset for help on using the changeset viewer.