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

Subversion Repositories s6soc

[/] [s6soc/] [trunk/] [sw/] [zipos/] [taskp.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:    taskp.h
4
//
5
// Project:     CMod S6 System on a Chip, ZipCPU demonstration project
6
//
7
// Purpose:     Defines the components of a task structure, containing all the
8
//              resources necessary to comprehend a user task: memory, state,
9
//      interrupt information, etc.
10
//
11
// Creator:     Dan Gisselquist, Ph.D.
12
//              Gisselquist Technology, LLC
13
//
14
////////////////////////////////////////////////////////////////////////////////
15
//
16
// Copyright (C) 2015-2016, Gisselquist Technology, LLC
17
//
18
// This program is free software (firmware): you can redistribute it and/or
19
// modify it under the terms of  the GNU General Public License as published
20
// by the Free Software Foundation, either version 3 of the License, or (at
21
// your option) any later version.
22
//
23
// This program is distributed in the hope that it will be useful, but WITHOUT
24
// ANY WARRANTY; without even the implied warranty of MERCHANTIBILITY or
25
// FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
26
// for more details.
27
//
28
// You should have received a copy of the GNU General Public License along
29
// with this program.  (It's in the $(ROOT)/doc directory, run make with no
30
// target there if the PDF file isn't present.)  If not, see
31
// <http://www.gnu.org/licenses/> for a copy.
32
//
33
// License:     GPL, v3, as defined and found on www.gnu.org,
34
//              http://www.gnu.org/licenses/gpl.html
35
//
36
//
37
////////////////////////////////////////////////////////////////////////////////
38
//
39
//
40
#ifndef TASKP_H
41
#define TASKP_H
42
 
43
#include "zipsys.h"
44
#include "ksched.h"
45
#include "kfildes.h"
46
 
47
#define MAX_KFILDES     4
48
 
49
typedef struct TASK_S { // Cost: 22+user_data
50
        KSCHED_STATE    state;
51
        int     context[16];
52
        KFILDES *fd[MAX_KFILDES];
53
        int     *user_heap, errno;
54
        // Interrupt processing.  Waitsig is a list of interupts the task
55
        // wishes to be woken for.  Pending is the list it hasn't yet seen.
56
        int     waitsig, pending;
57
        // Similarly, timeout is when the task wishes to be woken up (if set).
58
        unsigned        timeout;
59
        int     user_data[1];
60
        //
61
} TASK, *TASKP;
62
 
63
typedef void (*VENTRYP)(void);
64
typedef void (*FENTRYP)(int a, int b, int c, int d);
65
 
66
//
67
// Create a new task with ln words of memory and entry point entry.
68
//
69
TASKP   new_task(unsigned ln, VENTRYP entry);
70
 
71
//
72
// The entry point for the "special" idle task, whose only purpose is to call
73
// the idle function as often as possible.  (The CPU does nothing in idle mode)
74
// Calling this task will prevent the CPU from doing other more useful things,
75
// so it is the lowest priority task.
76
//
77
extern void     idle_task(void);
78
 
79
#endif

powered by: WebSVN 2.1.0

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