modify some headers.

This commit is contained in:
Lu Sitong 2021-03-01 15:14:24 +08:00
parent cd45f9d390
commit f73e6c054c
6 changed files with 34 additions and 0 deletions

View File

@ -1,3 +1,10 @@
#ifndef __SLEEPLOCK_H
#define __SLEEPLOCK_H
#include "include/spinlock.h"
#include "include/types.h"
// Long-term locks for processes
struct sleeplock {
uint locked; // Is the lock held?
@ -8,3 +15,4 @@ struct sleeplock {
int pid; // Process holding lock
};
#endif

View File

@ -1,3 +1,8 @@
#ifndef __SPINLOCK_H
#define __SPINLOCK_H
#include "include/proc.h"
// Mutual exclusion lock.
struct spinlock {
uint locked; // Is the lock held?
@ -7,3 +12,4 @@ struct spinlock {
struct cpu *cpu; // The cpu holding the lock.
};
#endif

View File

@ -1,3 +1,6 @@
#ifndef __STAT_H
#define __STAT_H
#define T_DIR 1 // Directory
#define T_FILE 2 // File
#define T_DEVICE 3 // Device
@ -18,3 +21,5 @@ struct stat {
// short nlink; // Number of links to file
// uint64 size; // Size of file in bytes
// };
#endif

View File

@ -1,3 +1,6 @@
#ifndef __SYSCALL_H
#define __SYSCALL_H
// System call numbers
#define SYS_fork 1
#define SYS_exit 2
@ -24,3 +27,5 @@
#define SYS_dev 23
#define SYS_dir 24
#define SYS_getcwd 25
#endif

View File

@ -1,3 +1,6 @@
#ifndef __TYPES_H
#define __TYPES_H
typedef unsigned int uint;
typedef unsigned short ushort;
typedef unsigned char uchar;
@ -12,3 +15,5 @@ typedef unsigned long uintptr_t;
typedef uint64 pde_t;
#define NULL ((void *)0)
#endif

View File

@ -1,3 +1,6 @@
#ifndef __VIRTIO_H
#define __VIRTIO_H
//
// virtio device definitions.
// for both the mmio interface, and virtio descriptors.
@ -70,3 +73,5 @@ struct UsedArea {
uint16 id;
struct VRingUsedElem elems[NUM];
};
#endif