OpenCores
URL https://opencores.org/ocsvn/s6soc/s6soc/trunk

Subversion Repositories s6soc

[/] [s6soc/] [trunk/] [sw/] [zipos/] [kfildes.h] - Blame information for rev 31

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 22 dgisselq
////////////////////////////////////////////////////////////////////////////////
2
//
3
// Filename:    kfildes.h
4
//
5
// Project:     CMod S6 System on a Chip, ZipCPU demonstration project
6
//
7
// Purpose:     Defines a "File Descriptor" from the standpoint of the kernel.
8
//              Inside the kernel, each process has an array of these file
9
//      descriptors.  Each file descriptor contains a pointer to the file
10
//      itself (typically a SYSPIPE), as well as to a device structure of
11
//      function pointers that can be used to operator on the file pointer.
12
//
13
//
14
// Creator:     Dan Gisselquist, Ph.D.
15
//              Gisselquist Technology, LLC
16
//
17
////////////////////////////////////////////////////////////////////////////////
18
//
19
// Copyright (C) 2015-2016, Gisselquist Technology, LLC
20
//
21
// This program is free software (firmware): you can redistribute it and/or
22
// modify it under the terms of  the GNU General Public License as published
23
// by the Free Software Foundation, either version 3 of the License, or (at
24
// your option) any later version.
25
//
26
// This program is distributed in the hope that it will be useful, but WITHOUT
27
// ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY or
28
// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
29
// for more details.
30
//
31
// You should have received a copy of the GNU General Public License along
32
// with this program.  (It's in the $(ROOT)/doc directory, run make with no
33
// target there if the PDF file isn't present.)  If not, see
34
// <http://www.gnu.org/licenses/> for a copy.
35
//
36
// License:     GPL, v3, as defined and found on www.gnu.org,
37
//              http://www.gnu.org/licenses/gpl.html
38
//
39
//
40
////////////////////////////////////////////////////////////////////////////////
41
//
42
//
43
#ifndef KFILDES_H
44
#define KFILDES_H
45
 
46
struct  TASK_S;
47
 
48
#define FILENO_STDIN    0
49
#define FILENO_STDOUT   1
50
#define FILENO_STDERR   2
51
#define FILENO_AUX      3
52
#define MAX_FILDES      4
53
 
54
typedef void    (*RWFDFUN)(struct TASK_S *,int, void *, int);
55
 
56
typedef struct  {
57
        void    (*write)(struct TASK_S *tsk, int id, void *buf, int len);
58
        void    (*read)( struct TASK_S *tsk, int id, void *buf, int len);
59
        void    (*close)(struct TASK_S *tsk, int id);
60
} KDEVICE;
61
 
62
typedef struct {
63
        int     id;
64
        KDEVICE *dev;
65
} KFILDES;
66
 
67
#ifndef NULL
68
#define NULL    (void *)0
69
#endif
70
 
71 29 dgisselq
KFILDES *kopen(int id, KDEVICE *dev);
72
 
73 22 dgisselq
#endif

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.