queue.h

00001 /***************************************************************************
00002                           queue.h  -  description
00003                              -------------------
00004     begin                : Wed Jan 14 2004
00005     copyright            : (C) 2004 by Dynacube Team
00006     email                : mdshah82@yahoo.com
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
00015  *                                                                         *
00016  ***************************************************************************/
00017 
00018  #ifndef __QUEUE_H
00019  #define __QUEUE_H
00020 
00021   #include "common/ktypes.h"
00022   #include "proc/proc.h"
00023   #include "common/kconst.h"
00024   
00025   #define E_UNDERFLOW -1
00026   #define E_OVERFLOW  -1
00027   #define E_EXISTS    -1
00028   #define E_FAILURE   -1
00029 
00030   typedef struct
00031   {
00032     DW front;
00033     DW end;
00034     DW q[MAX_PROC];
00035     DW max; //MAX_PROC
00036     DW n; //Current member count
00037   } QUEUE;
00038 
00039   extern QUEUE ready_q;
00040   extern QUEUE device_q[MAX_DEVICE];
00041   extern QUEUE message_q;
00042   extern QUEUE intr_q;
00043   extern QUEUE timer_q;
00044   extern QUEUE gui_q;
00045   extern QUEUE fs_q;
00046     
00047   void q_init(QUEUE *q_ptr);
00048   SDW enq(QUEUE *q_ptr,DW pid);
00049   SDW deq(QUEUE *q_ptr);
00050   SDW remove(QUEUE *q_ptr, DW pid);
00051   SDW findq(QUEUE *q_ptr, DW pid);
00052   void printQ(QUEUE *q_ptr);
00053   SDW get_first(QUEUE *q_ptr);
00054 
00055  #endif

Generated on Thu Jul 27 23:52:27 2006 for Dynacube by  doxygen 1.4.7