blob: 0038dcb4c3d581054bcfaabee399c1cae70ec346 [file] [log] [blame]
Jon Medhurst15ce78d2014-04-10 09:02:02 +01001/**
Jon Medhurstb1d07442015-05-08 12:04:18 +01002 * Copyright (C) ARM Limited 2010-2015. All rights reserved.
Jon Medhurst15ce78d2014-04-10 09:02:02 +01003 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License version 2 as
6 * published by the Free Software Foundation.
7 */
8
9#ifndef USERSPACESOURCE_H
10#define USERSPACESOURCE_H
11
12#include <semaphore.h>
13
14#include "Buffer.h"
15#include "Source.h"
16
Jon Medhurste31266f2014-08-04 15:47:44 +010017// User space counters
Jon Medhurst15ce78d2014-04-10 09:02:02 +010018class UserSpaceSource : public Source {
19public:
20 UserSpaceSource(sem_t *senderSem);
21 ~UserSpaceSource();
22
23 bool prepare();
24 void run();
25 void interrupt();
26
27 bool isDone();
28 void write(Sender *sender);
29
30private:
31 Buffer mBuffer;
32
33 // Intentionally unimplemented
34 UserSpaceSource(const UserSpaceSource &);
35 UserSpaceSource &operator=(const UserSpaceSource &);
36};
37
38#endif // USERSPACESOURCE_H