semoper.* renamed to atomic.*
This commit is contained in:
2
Makefile
2
Makefile
@@ -33,7 +33,7 @@ OBJS+= main.o
|
|||||||
OBJS+= syscall.o
|
OBJS+= syscall.o
|
||||||
OBJS+= usartu.o
|
OBJS+= usartu.o
|
||||||
OBJS+= scheduler.o
|
OBJS+= scheduler.o
|
||||||
OBJS+= semoper.o
|
OBJS+= atomic.o
|
||||||
OBJS+= semaphore.o
|
OBJS+= semaphore.o
|
||||||
|
|
||||||
main.elf: $(OBJS)
|
main.elf: $(OBJS)
|
||||||
|
|||||||
36
README.md
36
README.md
@@ -46,24 +46,20 @@ NanoOS: "Make less makes no sense" =)
|
|||||||
#### Ouput
|
#### Ouput
|
||||||
|
|
||||||
```
|
```
|
||||||
task 1 6932
|
task 2 1
|
||||||
task 2 7157
|
task 3 14
|
||||||
task 3 7390
|
task 4 27 1
|
||||||
task 4 7627 2
|
task 1 44
|
||||||
task 1 13844
|
task 2 6341
|
||||||
task 2 14301
|
task 3 6362
|
||||||
task 3 14762
|
task 4 6379 2
|
||||||
task 4 15235 3
|
task 1 6400
|
||||||
task 1 20760
|
task 2 12689
|
||||||
task 2 21449
|
task 3 12710
|
||||||
task 3 22138
|
task 4 12727 3
|
||||||
task 4 22843 4
|
task 1 12752
|
||||||
task 1 27676
|
task 2 19037
|
||||||
task 2 28597
|
task 3 19058
|
||||||
task 3 29514
|
task 4 19079 4
|
||||||
task 4 30451 5
|
task 1 19104
|
||||||
task 1 34592
|
|
||||||
task 2 35745
|
|
||||||
task 3 36890
|
|
||||||
task 4 38059 6
|
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -20,10 +20,10 @@ atom_inc32:
|
|||||||
.type atom_dec32, %function
|
.type atom_dec32, %function
|
||||||
|
|
||||||
atom_dec32:
|
atom_dec32:
|
||||||
1: ldrex r2, [r0]
|
2: ldrex r2, [r0]
|
||||||
sub r2, r2, r1
|
sub r2, r2, r1
|
||||||
strex r3, r2, [r0]
|
strex r3, r2, [r0]
|
||||||
teq r3, #0
|
teq r3, #0
|
||||||
bne 1b
|
bne 2b
|
||||||
mov r0, r2
|
mov r0, r2
|
||||||
bx lr
|
bx lr
|
||||||
2
main.c
2
main.c
@@ -18,7 +18,7 @@
|
|||||||
|
|
||||||
#include "scheduler.h"
|
#include "scheduler.h"
|
||||||
#include "usartu.h"
|
#include "usartu.h"
|
||||||
#include "semoper.h"
|
#include "atomic.h"
|
||||||
#include "semaphore.h"
|
#include "semaphore.h"
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "semaphore.h"
|
#include "semaphore.h"
|
||||||
#include "semoper.h"
|
#include "atomic.h"
|
||||||
|
|
||||||
void sem_init(sem_t* sem, int32_t value) {
|
void sem_init(sem_t* sem, int32_t value) {
|
||||||
sem->value = value;
|
sem->value = value;
|
||||||
|
|||||||
Reference in New Issue
Block a user