POK(kernelpart)
/home/jaouen/pok_official/pok/trunk/kernel/include/arch/x86/interrupt.h File Reference
#include <types.h>

Go to the source code of this file.

Data Structures

struct  interrupt_frame

Defines

#define INTERRUPT_HANDLER(name)
#define INTERRUPT_HANDLER_errorcode(name)
#define INTERRUPT_HANDLER_syscall(name)

Functions

void update_tss (interrupt_frame *frame)

Variables

uint32_t pok_tss

Define Documentation

#define INTERRUPT_HANDLER (   name)
Value:
void name (void);                                                       \
void name##_handler(interrupt_frame* frame);                            \
  asm (                                                                 \
      ".global "#name "                 \n"                             \
      "\t.type "#name",@function        \n"                             \
      #name":                           \n"                             \
      "cli                      \n"                             \
      "subl $4, %esp                    \n"                             \
      "pusha                            \n"                             \
      "push %ds                         \n"                             \
      "push %es                         \n"                             \
      "push %esp                        \n"                             \
      "mov $0x10, %ax                   \n"                             \
      "mov %ax, %ds                     \n"                             \
      "mov %ax, %es                     \n"                             \
      "call " #name"_handler            \n"                             \
      "call update_tss                  \n"                             \
      "addl $4, %esp                    \n"                             \
      "pop %es                          \n"                             \
      "pop %ds                          \n"                             \
      "popa                             \n"                             \
      "addl $4, %esp                    \n"                             \
      "sti                      \n"                             \
      "iret                             \n"                             \
      );                                                                \
void name##_handler(interrupt_frame* frame)

Definition at line 53 of file interrupt.h.

#define INTERRUPT_HANDLER_errorcode (   name)
Value:
void name (void);                                                       \
void name##_handler(interrupt_frame* frame);                    \
  asm (                                                                 \
      ".global "#name "                 \n"                             \
      "\t.type "#name",@function        \n"                             \
      #name":                           \n"                             \
      "cli                      \n"                             \
      "pusha                            \n"                             \
      "push %ds                         \n"                             \
      "push %es                         \n"                             \
      "push %esp                        \n"                             \
      "mov $0x10, %ax                   \n"                             \
      "mov %ax, %ds                     \n"                             \
      "mov %ax, %es                     \n"                             \
      "call " #name"_handler            \n"                             \
      "call update_tss                  \n"                             \
      "addl $4, %esp                    \n"                             \
      "pop %es                          \n"                             \
      "pop %ds                          \n"                             \
      "popa                             \n"                             \
      "addl $4, %esp                    \n"                             \
      "sti                      \n"                             \
      "iret                             \n"                             \
      );                                                                \
void name##_handler(interrupt_frame* frame)

Definition at line 81 of file interrupt.h.

#define INTERRUPT_HANDLER_syscall (   name)
Value:
int name (void);                                                        \
void name##_handler(interrupt_frame* frame);                            \
  asm (                                                                 \
      ".global "#name "                 \n"                             \
      "\t.type "#name",@function        \n"                             \
      #name":                           \n"                             \
      "cli                      \n"                             \
      "subl $4, %esp                    \n"                             \
      "pusha                            \n"                             \
      "push %ds                         \n"                             \
      "push %es                         \n"                             \
      "push %esp                        \n"                             \
      "mov $0x10, %ax                   \n"                             \
      "mov %ax, %ds                     \n"                             \
      "mov %ax, %es                     \n"                             \
      "call " #name"_handler            \n"                             \
      "movl %eax, 40(%esp)         \n" /* return value */  \
      "call update_tss                  \n"                             \
      "addl $4, %esp                    \n"                             \
      "pop %es                          \n"                             \
      "pop %ds                          \n"                             \
      "popa                             \n"                             \
      "addl $4, %esp                    \n"                             \
      "sti                      \n"                             \
      "iret                             \n"                             \
      );                                                                \
void name##_handler(interrupt_frame* frame)

Definition at line 108 of file interrupt.h.


Function Documentation

void update_tss ( interrupt_frame frame)

Definition at line 20 of file interrupt.c.

{
  uint32_t* esp0 = (&pok_tss) + 1;

  if ((frame->cs & 0xffff) != 0x8)
  {
    *esp0 = (uint32_t)frame + sizeof (interrupt_frame);
  }
}

Variable Documentation

Definition at line 39 of file gdt.c.