Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
Ordonnancement
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ASE-2021
Ordonnancement
Commits
2bc29528
Commit
2bc29528
authored
4 years ago
by
Thierno souleymane Bah
Browse files
Options
Downloads
Patches
Plain Diff
feat(irq_disable and irq_enable functions done and tested)
parent
7b36a7d1
No related branches found
No related tags found
No related merge requests found
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
hardware_.h
+0
-127
0 additions, 127 deletions
hardware_.h
pingpongpang.c
+1
-0
1 addition, 0 deletions
pingpongpang.c
try.c
+10
-0
10 additions, 0 deletions
try.c
with
11 additions
and
127 deletions
hardware_.h
deleted
100644 → 0
+
0
−
127
View file @
7b36a7d1
/* ------------------------------
$Id: hardware.h 114 2009-12-01 13:06:43Z simon_duquennoy $
------------------------------------------------------------
hardware.h
Interface de la bibliothèque de simulation du matériel.
*/
#ifndef _HARDWARE_H_
#define _HARDWARE_H_
/**
* CMD_
* commandes ATA-2
*/
#define CMD_SEEK 0x02
#define CMD_READ 0x04
#define CMD_WRITE 0x06
#define CMD_FORMAT 0x08
#define CMD_STATUS 0x12
#define CMD_DMASET 0x14
#define CMD_DSKINFO 0x16
#define CMD_MANUF 0xA2
#define CMD_DIAG 0xA4
/**
* Commandes de la MMU (registre MMU_CMD)
*/
#define MMU_PROCESS 0xCC
/* Commande d'activation/désactivation de la MMU */
#define MMU_RESET 0xD5
/* Commande de réinitialisation de la MMU */
/**
* Physical and virtual memory for MMU
*/
extern
void
*
physical_memory
;
extern
void
*
virtual_memory
;
/**
* prototype des fonctions-interruptions.
* une interruption ne recoit aucun paramêtre "d'appel",
* une interruption ne retourne aucun resultat, mais
* sa terminaison restaure le contexte d'exécution du programme interrompu.
*/
typedef
void
(
*
func_irq
)(
void
);
/**
* int init_hardware(const char *fileconfig);
* initialisation du matériel. Pas de "reinitialisation" possible.
* l'initialisation définit le matériel conformément aux spécifications
* fournies par le fichier dont le nom est "fileconfig".
* retourne 0 en cas de problème lors de l'initialisation.
*/
extern
int
init_hardware
(
const
char
*
fileconfig
);
/**
* IRQVECTOR
* donne la base d'un tableau de pointeur de fonction du type
* func_irq. la fonction IRQVECTOR[n]() est appelée lorsque
* l'interuption de niveau n est déclanchée par le matériel.
*/
#define IRQ_VECOTR_SIZE 256
extern
func_irq
*
irq_vector
;
/* n'utilisez pas cette variable */
#define IRQVECTOR irq_vector
/* préférez ce #define IRQVECTOR */
extern
int
SYSTICKDURATION
;
/* microseconde entre les SYSTICK */
/**
* MASTERBUFFER et SLAVEBUFFER
* Adresses des buffers de donnees des disques maitre et esclave
*/
/* n'utilisez pas ces variables*/
extern
unsigned
char
**
HDA_masterbufferaddress
,
**
HDB_masterbufferaddress
;
/* préférez ces #define MASTERBUFFER et SLAVEBUFFER */
#define MASTERBUFFER (*HDA_masterbufferaddress)
#define SLAVEBUFFER (*HDB_masterbufferaddress)
/**
* BASEADDRESS_RAM
* variable associée à adresse de base de la mémoire globale
* de la machine. Cette mémoire est commune à tout les programmes
* qui utilisent la librairie sur la même machine.
*
*/
extern
unsigned
char
*
baseGlobalMem
;
/* n'utilisez pas cette variable */
#define BASEADDRESS_RAM baseGlobalMem
/* préférez ce #define BASEADDRESS_RAM */
/**
* int _in(int port);
* lecture du contenu du registre matériel n° "port".
* retourne la valeur lue.
*/
int
_in
(
int
port
);
/**
* void _out(int port, int value);
* ecriture de la valeur "value" dans le registre matériel n° "port".
*/
void
_out
(
int
port
,
int
value
);
/**
* void _sleep(int irq_level);
* Stoppe l'activité du microprocesseur jusqu'à l'occurence
* une interruption de niveau au moins égale à "irqLevel".
*/
void
_sleep
(
int
irq_level
);
/**
* void _mask(int irqLevel);
* - cache au microprocesseur l'occurence d'interruptions
* de niveau inférieure à irqLevel.
* - 16ème bit à 0 : passage en mode protégé
* - 16ème bit à 1 : passage en mode user
*
*/
void
_mask
(
int
irq_level
);
/**
* void _int(int irqLevel);
* - lance une interruption logicielle de niveau irqLevel
*
*/
void
_int
(
int
irqLevel
);
#endif
This diff is collapsed.
Click to expand it.
pingpongpang.c
+
1
−
0
View file @
2bc29528
...
...
@@ -22,6 +22,7 @@ int main(int argc, char *argv[])
void
f_ping
(
void
*
args
)
{
//irq_disable();
while
(
1
)
{
printf
(
"A"
);
...
...
This diff is collapsed.
Click to expand it.
try.c
+
10
−
0
View file @
2bc29528
...
...
@@ -158,3 +158,13 @@ void start_sched()
yield
();
}
void
irq_disable
()
{
_mask
(
15
);
// blocks all IT
}
void
irq_enable
()
{
_mask
(
1
);
// allows all IT
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment