/* ================================================================================ RPL/2 (R) version 4.1.8 Copyright (C) 1989-2012 Dr. BERTRAND Joël This file is part of RPL/2. RPL/2 is free software; you can redistribute it and/or modify it under the terms of the CeCILL V2 License as published by the french CEA, CNRS and INRIA. RPL/2 is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the CeCILL V2 License for more details. You should have received a copy of the CeCILL License along with RPL/2. If not, write to info@cecill.info. ================================================================================ */ #include "rpl-conv.h" /* ================================================================================ Fonction 'ycol' ================================================================================ Entrées : pointeur sur une structure struct_processus -------------------------------------------------------------------------------- Sorties : -------------------------------------------------------------------------------- Effets de bord : néant ================================================================================ */ void instruction_ycol(struct_processus *s_etat_processus) { struct_objet *s_objet_argument; (*s_etat_processus).erreur_execution = d_ex; if ((*s_etat_processus).affichage_arguments == 'Y') { printf("\n YCOL "); if ((*s_etat_processus).langue == 'F') { printf("(définition de la colonne statistique Y)\n\n"); } else { printf("(definition of statistical Y column)\n\n"); } printf(" 1: %s\n", d_INT); return; } else if ((*s_etat_processus).test_instruction == 'Y') { (*s_etat_processus).nombre_arguments = -1; return; } if (test_cfsf(s_etat_processus, 31) == d_vrai) { if (empilement_pile_last(s_etat_processus, 1) == d_erreur) { return; } } if (depilement(s_etat_processus, &((*s_etat_processus).l_base_pile), &s_objet_argument) == d_erreur) { (*s_etat_processus).erreur_execution = d_ex_manque_argument; return; } if ((*s_objet_argument).type == INT) { if ((*((integer8 *) (*s_objet_argument).objet)) <= 0) { liberation(s_etat_processus, s_objet_argument); (*s_etat_processus).erreur_execution = d_ex_argument_invalide; return; } (*s_etat_processus).colonne_statistique_2 = (*((integer8 *) (*s_objet_argument).objet)); } else { liberation(s_etat_processus, s_objet_argument); (*s_etat_processus).erreur_execution = d_ex_erreur_type_argument; return; } liberation(s_etat_processus, s_objet_argument); return; } /* ================================================================================ Fonction 'yield' ================================================================================ Entrées : pointeur sur une structure struct_processus -------------------------------------------------------------------------------- Sorties : -------------------------------------------------------------------------------- Effets de bord : néant ================================================================================ */ void instruction_yield(struct_processus *s_etat_processus) { (*s_etat_processus).erreur_execution = d_ex; if ((*s_etat_processus).affichage_arguments == 'Y') { printf("\n YIELD "); if ((*s_etat_processus).langue == 'F') { printf("(cessation de l'usage du processeur)\n\n"); printf(" Aucun argument\n"); } else { printf("(yield the processor)\n\n"); printf(" No argument\n"); } return; } else if ((*s_etat_processus).test_instruction == 'Y') { (*s_etat_processus).nombre_arguments = -1; return; } if ((*s_etat_processus).profilage == d_vrai) { profilage(s_etat_processus, "YIELD"); } if (test_cfsf(s_etat_processus, 31) == d_vrai) { if (empilement_pile_last(s_etat_processus, 0) == d_erreur) { return; } } sched_yield(); if ((*s_etat_processus).profilage == d_vrai) { profilage(s_etat_processus, NULL); } return; } // vim: ts=4