The Pedigree Project
0.1
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
src
modules
drivers
common
cdi
include
cdi-osdep.h
1
/*
2
* Copyright (c) 2009 Kevin Wolf
3
*
4
* This program is free software. It comes without any warranty, to
5
* the extent permitted by applicable law. You can redistribute it
6
* and/or modify it under the terms of the Do What The Fuck You Want
7
* To Public License, Version 2, as published by Sam Hocevar. See
8
* http://sam.zoy.org/projects/COPYING.WTFPL for more details.
9
*/
10
11
#ifndef _CDI_OSDEP_H_
12
#define _CDI_OSDEP_H_
13
14
#include "modules/Module.h"
15
#include "pedigree/kernel/utilities/utility.h"
16
17
#pragma GCC diagnostic push
18
#pragma GCC diagnostic ignored "-Wvariadic-macros"
19
20
struct
cdi_driver;
21
41
#define CDI_DRIVER(name, drvobj, deps...) \
43
static bool mod_entry() {(drvobj).drv.init(); return cdi_pedigree_walk_dev_list_init((struct cdi_driver*)&(drvobj));} \
44
static void mod_exit() {cdi_pedigree_walk_dev_list_destroy((struct cdi_driver*)&(drvobj)); (drvobj).drv.destroy();} \
45
MODULE_INFO(name, &mod_entry, &mod_exit, "cdi" deps)
46
47
#ifdef __cplusplus
48
extern
"C"
{
49
#endif
50
60
bool
cdi_pedigree_walk_dev_list_init(
struct
cdi_driver *dev);
61
71
void
cdi_pedigree_walk_dev_list_destroy(
struct
cdi_driver *dev);
72
73
#ifdef __cplusplus
74
};
// extern "C"
75
#endif
76
82
typedef
struct
83
{
84
void
*backdev;
85
}
cdi_pci_device_osdep
;
86
92
typedef
struct
93
{
94
void
*region;
95
void
*realbuffer;
96
}
cdi_dma_osdep
;
97
106
typedef
struct
{
108
void
*
pMemRegion
;
109
}
cdi_mem_osdep
;
110
114
struct
FILE
115
{
116
char
empty;
117
};
118
119
// Forward cdi drivers to the correct utility functions.
120
#define memcpy MemoryCopy
121
#define memset ByteSet
122
123
#pragma GCC diagnostic pop
124
125
#endif
FILE
Definition:
cdi-osdep.h:114
cdi_dma_osdep
Definition:
cdi-osdep.h:92
cdi_pci_device_osdep
Definition:
cdi-osdep.h:82
cdi_mem_osdep
Definition:
cdi-osdep.h:106
cdi_mem_osdep::pMemRegion
void * pMemRegion
A MemoryRegion on the kernel heap.
Definition:
cdi-osdep.h:108
Generated on Fri Jan 24 2020 06:46:12 for The Pedigree Project by
1.8.11