new: 在devfs中使用键盘文件(仍存在bug)

This commit is contained in:
fslongjin
2022-09-07 00:05:34 +08:00
parent 86a5f25e07
commit d7423f36be
15 changed files with 644 additions and 213 deletions

View File

@ -138,6 +138,26 @@ static inline void list_del(struct List *entry)
entry->prev->next = entry->next;
}
/**
* @brief 将新的链表结点替换掉旧的链表结点并使得旧的结点的前后指针均为NULL
*
* @param old 要被替换的结点
* @param new 新的要换上去的结点
*/
static inline void list_replace(struct List* old, struct List * new)
{
if(old->prev!=NULL)
old->prev->next=new;
new->prev = old->prev;
if(old->next!=NULL)
old->next->prev = new;
new->next = old->next;
old->prev = NULL;
old->next = NULL;
}
static inline bool list_empty(struct List *entry)
{
/**

View File

@ -39,7 +39,7 @@ long strnlen(const char *src, unsigned long maxlen)
FirstPart < SecondPart => -1
*/
int strcmp(char *FirstPart, char *SecondPart)
int strcmp(const char *FirstPart, const char *SecondPart)
{
register int __res;
__asm__ __volatile__("cld \n\t"

View File

@ -38,7 +38,7 @@ long strnlen(const char *src, unsigned long maxlen);
FirstPart < SecondPart => -1
*/
int strcmp(char *FirstPart, char *SecondPart);
int strcmp(const char *FirstPart, const char *SecondPart);
char *strncpy(char *dst, const char *src, long count);