Skip to content
Snippets Groups Projects
Commit ecf3a1a2 authored by Christoph Hellwig's avatar Christoph Hellwig
Browse files

make osv/ headers safely includable from C++

parent 2b99a6a5
No related branches found
No related tags found
No related merge requests found
extern "C" {
#include <osv/prex.h>
#include <osv/device.h>
}
#include "isa-serial.hh"
#include "debug-console.hh"
......
......@@ -38,10 +38,13 @@
#ifndef _SYS_BIO_H_
#define _SYS_BIO_H_
#include <sys/cdefs.h>
#include <stdint.h>
#include <pthread.h>
#include <osv/list.h>
__BEGIN_DECLS
/* bio_cmd */
#define BIO_READ 0x01
#define BIO_WRITE 0x02
......@@ -96,4 +99,6 @@ void destroy_bio(struct bio *bio);
void biodone(struct bio *bio);
__END_DECLS
#endif /* !_SYS_BIO_H_ */
......@@ -35,6 +35,8 @@
#include <osv/uio.h>
__BEGIN_DECLS
#define MAXDEVNAME 12
#define DO_RWMASK 0x3
......@@ -133,4 +135,6 @@ int physio(struct device *dev, struct uio *uio, int ioflags);
struct device * device_create(struct driver *drv, const char *name, int flags);
__END_DECLS
#endif /* !_DEVICE_H */
......@@ -30,8 +30,11 @@
#ifndef _SYS_FILE_H_
#define _SYS_FILE_H_
#include <sys/cdefs.h>
#include <sys/types.h>
__BEGIN_DECLS
struct vnode;
/*
......@@ -45,4 +48,6 @@ struct file {
};
typedef struct file *file_t;
__END_DECLS
#endif /* !_SYS_FILE_H_ */
......@@ -32,6 +32,8 @@
#include <sys/cdefs.h>
__BEGIN_DECLS
struct list_head {
struct list_head *next;
struct list_head *prev;
......@@ -78,4 +80,6 @@ list_remove(list_t node)
node->next->prev = node->prev;
}
__END_DECLS
#endif /* !_SYS_LIST_H_ */
......@@ -36,6 +36,8 @@
#include <sys/statfs.h>
#include <osv/vnode.h>
__BEGIN_DECLS
/*
* Mount data
*/
......@@ -125,7 +127,6 @@ typedef int (*vfsop_statfs_t)(mount_t, struct statfs *);
#define VFS_NULL ((void *)vfs_null)
__BEGIN_DECLS
int mount(const char *, const char *, const char *, int, void *);
int umount(const char *);
int vfs_nullop(void);
......
#ifndef _OSV_PREX_H
#define _OSV_PREX_H 1
#include <sys/cdefs.h>
#include <unistd.h>
__BEGIN_DECLS
#define TASK_NULL ((task_t)0)
#define BSIZE 512 /* size of secondary block (bytes) */
......@@ -32,3 +38,7 @@ size_t strlcat(char *dst, const char *src, size_t siz);
size_t strlcpy(char *dst, const char *src, size_t siz);
void sys_panic(const char *);
__END_DECLS
#endif /* _OSV_PREX_H */
......@@ -33,10 +33,13 @@
#ifndef _UIO_H_
#define _UIO_H_
#include <sys/cdefs.h>
#include <sys/types.h>
#include <sys/uio.h>
#include <limits.h>
__BEGIN_DECLS
enum uio_rw { UIO_READ, UIO_WRITE };
/*
......@@ -56,4 +59,6 @@ struct uio {
int copyinuio(struct iovec *iovp, u_int iovcnt, struct uio **uiop);
int uiomove(void *cp, int n, struct uio *uio);
__END_DECLS
#endif /* !_UIO_H_ */
......@@ -30,14 +30,16 @@
#ifndef _SYS_VNODE_H_
#define _SYS_VNODE_H_
#include <sys/cdefs.h>
#include <sys/stat.h>
#include <osv/prex.h>
#include <osv/uio.h>
#include "file.h"
#include <osv/list.h>
#include "dirent.h"
__BEGIN_DECLS
struct vfsops;
struct vnops;
struct vnode;
......@@ -166,7 +168,6 @@ struct vnops {
#define VOP_INACTIVE(VP) ((VP)->v_op->vop_inactive)(VP)
#define VOP_TRUNCATE(VP, N) ((VP)->v_op->vop_truncate)(VP, N)
__BEGIN_DECLS
int vop_nullop(void);
int vop_einval(void);
vnode_t vn_lookup(struct mount *, char *);
......@@ -181,6 +182,7 @@ void vref(vnode_t);
void vrele(vnode_t);
int vcount(vnode_t);
void vflush(struct mount *);
__END_DECLS
#endif /* !_SYS_VNODE_H_ */
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment