2010-07-28 18:46:13 -05:00
|
|
|
#ifndef RUST_PORT_H
|
|
|
|
#define RUST_PORT_H
|
|
|
|
|
2011-07-29 13:00:44 -05:00
|
|
|
class rust_port : public kernel_owned<rust_port>, public rust_cond {
|
2010-07-28 18:46:13 -05:00
|
|
|
public:
|
2011-11-11 18:12:48 -06:00
|
|
|
RUST_REFCOUNTED(rust_port)
|
2011-07-29 13:00:44 -05:00
|
|
|
|
2011-08-08 20:09:42 -05:00
|
|
|
rust_port_id id;
|
|
|
|
|
2011-07-07 13:53:08 -05:00
|
|
|
rust_kernel *kernel;
|
2010-07-28 18:46:13 -05:00
|
|
|
rust_task *task;
|
|
|
|
size_t unit_sz;
|
2011-11-11 13:46:07 -06:00
|
|
|
circular_buffer buffer;
|
2010-07-28 18:46:13 -05:00
|
|
|
|
2011-07-07 13:53:08 -05:00
|
|
|
lock_and_signal lock;
|
|
|
|
|
2010-07-28 18:46:13 -05:00
|
|
|
rust_port(rust_task *task, size_t unit_sz);
|
|
|
|
~rust_port();
|
2010-08-09 09:52:07 -05:00
|
|
|
void log_state();
|
2011-11-10 19:53:19 -06:00
|
|
|
void send(void *sptr);
|
2010-08-09 10:15:34 -05:00
|
|
|
bool receive(void *dptr);
|
2011-11-13 17:28:59 -06:00
|
|
|
size_t size();
|
2011-11-16 18:44:08 -06:00
|
|
|
void detach();
|
2010-07-28 18:46:13 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
//
|
|
|
|
// Local Variables:
|
|
|
|
// mode: C++
|
|
|
|
// fill-column: 78;
|
|
|
|
// indent-tabs-mode: nil
|
|
|
|
// c-basic-offset: 4
|
|
|
|
// buffer-file-coding-system: utf-8-unix
|
2011-07-13 15:51:20 -05:00
|
|
|
// compile-command: "make -k -C $RBUILD 2>&1 | sed -e 's/\\/x\\//x:\\//g'";
|
2010-07-28 18:46:13 -05:00
|
|
|
// End:
|
|
|
|
//
|
|
|
|
|
|
|
|
#endif /* RUST_PORT_H */
|