usb: getting string descriptors, minor improvements
[quarnos.git] / modules / module.h
blob6a30eab86c7ad8309bbcac1a9dab33bd448744ea
1 /* Quarn OS
3 * Module
5 * Copyright (C) 2008-2009 Pawel Dziepak
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License along
18 * with this program; if not, write to the Free Software Foundation, Inc.,
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23 #ifndef _MODULE_H_
24 #define _MODULE_H_
26 #include "manes/manec.h"
28 namespace modules {
29 class module : public manes::cds::component {
30 public:
31 typedef enum {
32 module_kernel_space,
33 module_user_space,
34 module_network
35 } module_type;
36 private:
37 string *mname;
39 module_type mtype;
40 struct {
41 void *code_start;
42 int code_size;
44 void *data_start;
45 int data_size;
47 void *bss_start;
48 int bss_size;
49 } kernel_space;
51 protected:
52 void (*enter_module)(/*manes::component**/);
54 public:
55 virtual void load(const string &prog) = 0;
56 void place(module_type);
58 void enter();
60 delegate<void> get_delegate();
62 static void register_type();
66 #endif