Newer
Older
UbixOS / sys / include / ubixos / wait.h
@Charlie Root Charlie Root on 11 Jan 2018 552 bytes Working On VFS
#ifndef _UBIXOS_WAIT_H
#define _UBIXOS_WAIT_H


struct wait_queue {
//  struct kTask_t *task;
  struct wait_queue *next;
};

struct semaphore {
  int sount;
  struct wait_queue *wait;
};

#define sti() __asm__ __volatile__ ("sti": : :"memory")
#define cli() __asm__ __volatile__ ("cli": : :"memory")
#define nop() __asm__ __volatile__ ("nop")

#define save_flags(x) __asm__ __volatile__("pushfl ; popl %0":"=r" (x): /* no input */ :"memory")

#define restore_flags(x) __asm__ __volatile__("pushl %0 ; popfl": /* no output */ :"r" (x):"memory")

#endif