-
Notifications
You must be signed in to change notification settings - Fork 56
/
Copy pathCompleter.h
47 lines (39 loc) · 928 Bytes
/
Completer.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
//
// Completer.h
// GenericUSBXHCI
//
// Created by Zenith432 on October 18th 2013.
// Copyright (c) 2013 Zenith432. All rights reserved.
//
//
#ifndef GenericUSBXHCI_Completer_h
#define GenericUSBXHCI_Completer_h
#include <IOKit/usb/USB.h>
class GenericUSBXHCI;
class Completer
{
private:
struct CompleterItem
{
IOUSBCompletion completion;
IOReturn status;
uint32_t actualByteCount;
CompleterItem* next;
};
GenericUSBXHCI* owner;
CompleterItem* activeHead;
CompleterItem* activeTail;
CompleterItem* freeHead;
CompleterItem* freeTail;
uint32_t freeCount;
bool flushing;
void InternalFlush(void);
public:
__attribute__((always_inline))
void setOwner(GenericUSBXHCI* owner) { this->owner = owner; }
bool AddItem(IOUSBCompletion const*, IOReturn, uint32_t, bool);
__attribute__((always_inline))
void Flush(void) { if (activeHead && !flushing) InternalFlush(); }
void Finalize(void);
};
#endif