first shell implementation

This commit is contained in:
tkl
2016-08-02 11:41:47 +02:00
parent a2cddd208f
commit 35af737f68
3 changed files with 61 additions and 5 deletions

View File

@@ -0,0 +1,24 @@
/*
* list.h
*
* Created on: Jul 27, 2016
* Author: tkl
*/
#ifndef SOURCE_FIRMWARE_KERNEL_LIST_H_
#define SOURCE_FIRMWARE_KERNEL_LIST_H_
struct list_node {
struct list_node *next;
unsigned int data;
};
struct list {
struct list_node *front;
struct list_node *rear;
};
int list_init(struct list *head);
int list_add(struct list *head, struct list_node *node);
#endif /* SOURCE_FIRMWARE_KERNEL_LIST_H_ */

View File

@@ -8,7 +8,15 @@
#ifndef SOURCE_FIRMWARE_KERNEL_INTERFACE_SHELL_H_
#define SOURCE_FIRMWARE_KERNEL_INTERFACE_SHELL_H_
typedef void *(*command_callback)(const char*);
struct command {
const char *command;
const command_callback command_callback;
struct list_node item;
};
int shell_init(const struct driver *shell_device);
int shell_add_command(const char *command, const void *callback, const void *param);
int shell_add_command(struct command *command);
#endif /* SOURCE_FIRMWARE_KERNEL_INTERFACE_SHELL_H_ */