program.h
Go to the documentation of this file.
1
6/*
7 * The contents of this file are subject to the Mozilla Public License
8 * Version 1.0 (the "License"); you may not use this file except in
9 * compliance with the License. You may obtain a copy of the License
10 * at http://www.mozilla.org/MPL/
11 *
12 * Software distributed under the License is distributed on an "AS IS"
13 * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
14 * the License for the specific language governing rights and
15 * limitations under the License.
16 *
17 * The Original Code is legOS code, released October 17, 1999.
18 *
19 * The Initial Developer of the Original Code is Markus L. Noga.
20 * Portions created by Markus L. Noga are Copyright (C) 1999
21 * Markus L. Noga. All Rights Reserved.
22 *
23 * Contributor(s): Markus L. Noga <markus@noga.de>
24 */
25
26#ifndef __program_h__
27#define __program_h__
28
29#ifdef __cplusplus
30extern "C" {
31#endif
32
33#include <config.h>
34
35#ifdef CONF_PROGRAM
36
37#include <tm.h>
38
40//
41// Definitions
42//
44
45#define PROG_MAX 8
46
47#ifndef DOXYGEN_SHOULD_SKIP_INTERNALS
52typedef struct {
53 void *text;
54 void *data;
55 void *bss;
56 void *data_orig;
57
58 size_t text_size;
59 size_t data_size;
60 size_t bss_size;
61 size_t stack_size;
62 size_t start;
64
65 size_t downloaded;
66} program_t;
67
71typedef enum {
75 // s[bsssize] s[stacksize]
76 // s[start] b[prio]
82 CMDlast
84
85#endif /* DOXYGEN_SHOULD_SKIP_INTERNALS */
86
88//
89// Variables
90//
92
93extern volatile unsigned cprog;
94
96//
97// Functions
98//
100
102extern void program_stop(int flag);
103
105
106extern int program_valid(unsigned nr);
107
109extern void program_init();
110
112extern void program_shutdown();
113
114#endif // CONF_PROGRAM
115
116#ifdef __cplusplus
117}
118#endif
119
120#endif // __program_h__
kernel configuration file
int program_valid(unsigned nr)
check if a given program is valid.
packet_cmd_t
Definition: program.h:71
@ CMDrun
1+ 1: b[nr]
Definition: program.h:79
@ CMDdelete
1+ 1: b[nr]
Definition: program.h:73
@ CMDlast
?
Definition: program.h:82
@ CMDsethost
1+ 1: b[hostaddr]
Definition: program.h:81
@ CMDdata
1+>3: b[nr] s[offset] array[data]
Definition: program.h:78
@ CMDirmode
1+ 1: b[0=near/1=far]
Definition: program.h:80
@ CMDoffsets
1+ 7: b[nr] s[text] s[data] s[bss]
Definition: program.h:77
@ CMDcreate
1+12: b[nr] s[textsize] s[datasize]
Definition: program.h:74
@ CMDacknowledge
1:
Definition: program.h:72
void program_shutdown()
shutdown program support
void program_init()
initialize program support
volatile unsigned cprog
the current program
void program_stop(int flag)
stop program
The program control structure.
Definition: program.h:52
priority_t prio
priority to run this program at
Definition: program.h:63
size_t stack_size
stack segment size in bytes
Definition: program.h:61
void * bss
origin of bss segment (imm. after data)
Definition: program.h:55
void * text
origin of text segment
Definition: program.h:53
void * data
origin of data segment (imm. after text)
Definition: program.h:54
size_t downloaded
number of bytes downloaded so far.
Definition: program.h:65
size_t data_size
data segment size in bytes
Definition: program.h:59
size_t text_size
text segment size in bytes
Definition: program.h:58
void * data_orig
origin of backup copy of data segment
Definition: program.h:56
size_t start
offset from text segment to start into.
Definition: program.h:62
size_t bss_size
bss segment size in bytes
Definition: program.h:60
Interface: task management.
unsigned char priority_t
task priority type
Definition: tm.h:48

brickOS is released under the Mozilla Public License.
Original code copyright 1998-2005 by the authors.

Generated for brickOS Kernel Developer by doxygen 1.9.4