blob: ec27b0815bbfe52dfbce9dcd52cf5a3829401a1b [file] [log] [blame]
* Copyright (C) ARM Limited 2010-2014. All rights reserved.
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
#include <semaphore.h>
#include <stdint.h>
#include "Source.h"
class Buffer;
class Fifo;
class DriverSource : public Source {
DriverSource(sem_t *senderSem, sem_t *startProfile);
bool prepare();
void run();
void interrupt();
bool isDone();
void write(Sender *sender);
static int readIntDriver(const char *fullpath, int *value);
static int readInt64Driver(const char *fullpath, int64_t *value);
static int writeDriver(const char *fullpath, const char *data);
static int writeDriver(const char *path, int value);
static int writeDriver(const char *path, int64_t value);
static int writeReadDriver(const char *path, int *value);
static int writeReadDriver(const char *path, int64_t *value);
static void *bootstrapThreadStatic(void *arg);
void bootstrapThread();
Buffer *mBuffer;
Fifo *mFifo;
sem_t *const mSenderSem;
sem_t *const mStartProfile;
int mBufferSize;
int mBufferFD;
int mLength;
// Intentionally unimplemented
DriverSource(const DriverSource &);
DriverSource &operator=(const DriverSource &);