1//
2// Glue to make IO Kit happy with BootCache as a non-NKE KEXT.
3//
4
5#include <IOKit/IOService.h>
6
7/*
8 * Hooks from c++ glue to the cache core.
9 */
10extern "C" void	BC_load(void);
11extern "C" int	BC_unload(void);
12
13class com_apple_BootCache : public IOService
14{
15	OSDeclareDefaultStructors(com_apple_BootCache);
16
17public:
18	virtual bool	start(IOService *provider);
19	virtual void	stop(IOService *provider);
20};
21
22OSDefineMetaClassAndStructors(com_apple_BootCache, IOService);
23
24bool
25com_apple_BootCache::start(IOService *provider)
26{
27	bool	result;
28
29	result = IOService::start(provider);
30	if (result == true) {
31		BC_load();
32		provider->retain();
33	}
34	return(result);
35}
36
37void
38com_apple_BootCache::stop(IOService *provider)
39{
40	if (BC_unload())
41		return;	// refuse unload?
42	provider->release();
43	IOService::stop(provider);
44}
45