diagdummy Test concurrent openfs
This commit is contained in:
@ -1,6 +0,0 @@
|
|||||||
#ifndef DIAGDUMMY_BLOCK_H_
|
|
||||||
#define DIAGDUMMY_BLOCK_H_
|
|
||||||
|
|
||||||
void diagdummy_block(void);
|
|
||||||
|
|
||||||
#endif // DIAGDUMMY_BLOCK_H_
|
|
||||||
@ -1,5 +1,7 @@
|
|||||||
#include <ulib.h>
|
#include <ulib.h>
|
||||||
#include "block.h"
|
|
||||||
|
#define CMDS(X) \
|
||||||
|
X(block) X(openf)
|
||||||
|
|
||||||
void main(void) {
|
void main(void) {
|
||||||
if (argslen() == 0) {
|
if (argslen() == 0) {
|
||||||
@ -9,9 +11,13 @@ void main(void) {
|
|||||||
|
|
||||||
char *cmd = args()[0];
|
char *cmd = args()[0];
|
||||||
|
|
||||||
if (string_strcmp(cmd, "block") == 0) {
|
#define X(name) if (string_strcmp(cmd, #name) == 0) { \
|
||||||
diagdummy_block();
|
extern void diagdummy_ ## name(void); \
|
||||||
} else {
|
diagdummy_ ## name(); \
|
||||||
|
return; \
|
||||||
|
}
|
||||||
|
CMDS(X)
|
||||||
|
#undef X
|
||||||
|
|
||||||
uprintf("diagdummy: unknown cmd %s\n", cmd);
|
uprintf("diagdummy: unknown cmd %s\n", cmd);
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
9
user/diagdummy/openf.c
Normal file
9
user/diagdummy/openf.c
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
#include <stdint.h>
|
||||||
|
#include <stddef.h>
|
||||||
|
#include <ulib.h>
|
||||||
|
|
||||||
|
void diagdummy_openf(void) {
|
||||||
|
fsh_t h = fs_openf("base:/bin/init", FS_OF_READ);
|
||||||
|
uprintf("h = %d\n", h);
|
||||||
|
for(;;);
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user