Line 44... |
Line 44... |
// Creator: Dan Gisselquist, Ph.D.
|
// Creator: Dan Gisselquist, Ph.D.
|
// Gisselquist Technology, LLC
|
// Gisselquist Technology, LLC
|
//
|
//
|
////////////////////////////////////////////////////////////////////////////////
|
////////////////////////////////////////////////////////////////////////////////
|
//
|
//
|
// Copyright (C) 2015-2016, Gisselquist Technology, LLC
|
// Copyright (C) 2015-2017, Gisselquist Technology, LLC
|
//
|
//
|
// This program is free software (firmware): you can redistribute it and/or
|
// This program is free software (firmware): you can redistribute it and/or
|
// modify it under the terms of the GNU General Public License as published
|
// modify it under the terms of the GNU General Public License as published
|
// by the Free Software Foundation, either version 3 of the License, or (at
|
// by the Free Software Foundation, either version 3 of the License, or (at
|
// your option) any later version.
|
// your option) any later version.
|
Line 71... |
Line 71... |
//
|
//
|
//
|
//
|
#ifndef SYSPIPE_H
|
#ifndef SYSPIPE_H
|
#define SYSPIPE_H
|
#define SYSPIPE_H
|
|
|
extern void *sys_malloc(int sz);
|
typedef unsigned size_t;
|
|
|
|
extern void *sys_malloc(size_t sz);
|
|
|
typedef struct {
|
typedef struct {
|
unsigned int m_mask;
|
unsigned int m_mask;
|
int m_head, m_tail;
|
int m_head, m_tail;
|
volatile TASKP m_rdtask, m_wrtask;
|
volatile TASKP m_rdtask, m_wrtask;
|
unsigned int m_nread, m_nwritten;
|
unsigned int m_nread, m_nwritten;
|
int dummy;
|
int dummy;
|
int m_error;
|
int m_error;
|
|
|
int m_buf[1];
|
char m_buf[1];
|
} SYSPIPE;
|
} SYSPIPE;
|
|
|
SYSPIPE *new_syspipe(const unsigned int len);
|
SYSPIPE *new_syspipe(const unsigned int len);
|
extern void kread_syspipe( TASKP tsk, int dev, int *dst, int len);
|
extern void kread_syspipe( TASKP tsk, int dev, char *dst, int len);
|
extern void kwrite_syspipe(TASKP tsk, int dev, int *src, int len);
|
extern void kwrite_syspipe(TASKP tsk, int dev, char *src, int len);
|
void kpush_syspipe(SYSPIPE *p, int val);
|
void kpush_syspipe(SYSPIPE *p, char val);
|
int kpop_syspipe(SYSPIPE *p, int *val);
|
int kpop_syspipe(SYSPIPE *p, char *val);
|
|
int kpop_short_syspipe(SYSPIPE *p, unsigned short *val);
|
extern int num_avail_syspipe(SYSPIPE *p);
|
extern int num_avail_syspipe(SYSPIPE *p);
|
extern int len_syspipe(SYSPIPE *p);
|
extern int len_syspipe(SYSPIPE *p);
|
|
|
#define INTERRUPT_READ_TASK ((TASKP)((unsigned)-1))
|
#define INTERRUPT_READ_TASK ((TASKP)((unsigned)-1))
|
// #define INTERRUPT_WRITE_TASK ((TASKP)((unsigned)-1))
|
// #define INTERRUPT_WRITE_TASK ((TASKP)((unsigned)-1))
|