Exemple #1
0
/*
 * Send a signal to a process 
 * Params:
 *   state->ebx - pid of process to send signal to
 *   state->ecx - signal number
 * Returns: 0 on success or error code (< 0) on error
 */
static int Sys_Kill(struct Interrupt_State* state)
{
	struct Kernel_Thread* kthread = NULL;
	kthread = Lookup_Thread(state->ebx, false);
	Send_Signal(kthread, state->ecx);
	if(kthread->blocked == true){
		Wake_Up_Process(kthread);
	}
	if(Get_Current()->pid != kthread->owner) kthread->refCount-- ; /* deref */
	return 0;

}
Exemple #2
0
/*
 * Send a signal to a process
 * Params:
 *   state->ebx - pid of process to send signal to
 *   state->ecx - signal number
 * Returns: 0 on success or error code (< 0) on error
 */
static int Sys_Kill(struct Interrupt_State *state) {
    struct Kernel_Thread *kthread = Lookup_Thread(state->ebx, 1);
    if (kthread == 0)
        return EINVALID;

    if (!IS_SIGNUM(state->ecx))
        return EINVALID;

    if (kthread->userContext == 0)
        return EINVALID;

    Send_Signal(kthread, state->ecx);
    return 0;
}
Exemple #3
0
void UpdateRTC()
{
        Send_Signal(SIG_TIME_UPDATE);
        Date_Time.Second++;
	if (Date_Time.Second == 60) 	//SECOND
	{
            Date_Time.Second = 0;
            Date_Time.Minute++;
	    if(Date_Time.Minute == 60)		//MINUTE
	    {
	        Date_Time.Minute = 0;
	        Date_Time.Hour++;
		if(Date_Time.Hour == 24)		//HOUR
		{
	            Date_Time.Hour = 0;
		    Date_Time.Day++;
		    if(Date_Time.Day == 30)		//DAY
		    {
                        Date_Time.Day = 0;
                        Date_Time.Month++;
			if(Date_Time.Month == 12)		//MONTH
			{
			    Date_Time.Month = 0;
			    Date_Time.Year++;	
			    if(Date_Time.Year == 99) //YEAR
			    {
				Date_Time.Year = 0;				
			    }//YEAR						
			}//MOUNTH
		    }//DATE
		}//HOUR
	    }//MINUTE
        }//SECOND
    //  ShowDateTime();
 /*     if (Reservation != 0){
          if (ReservationTimeUP() != 0){
               AddReservationCommand(&Reservation->Intervel);
          }
      }*/
}