ns-3 Direct Code Execution
Home
Tutorials ▼
Docs ▼
Wiki
Manual
Develop ▼
API
Bugs
API
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Pages
ucontext-fiber-manager.h
Go to the documentation of this file.
1
#ifndef UCONTEXT_FIBER_MANAGER_H
2
#define UCONTEXT_FIBER_MANAGER_H
3
4
#include "
fiber-manager.h
"
5
#include <signal.h>
6
#include <list>
7
8
namespace
ns3 {
9
10
class
UcontextFiberManager
:
public
FiberManager
11
{
12
public
:
13
UcontextFiberManager
();
14
virtual
~UcontextFiberManager
();
15
16
virtual
struct
Fiber
*
Create
(
void
(*callback)(
void
*),
17
void
*context,
18
uint32_t stackSize);
19
virtual
struct
Fiber
*
CreateFromCaller
(
void
);
20
virtual
void
Delete
(
struct
Fiber
*fiber);
21
virtual
void
SwitchTo
(
struct
Fiber
*from,
22
const
struct
Fiber
*to);
23
virtual
uint32_t
GetStackSize
(
struct
Fiber
*fiber)
const
;
24
virtual
void
SetSwitchNotification
(
void
(*fn)(
void
));
25
private
:
26
static
void
SegfaultHandler
(
int
sig, siginfo_t *si,
void
*unused);
27
// invoked as atexit handler
28
static
void
FreeAlternateSignalStack
(
void
);
29
30
void
SetupSignalHandler
(
void
);
31
uint32_t
CalcStackSize
(uint32_t size);
32
uint8_t *
AllocateStack
(uint32_t stackSize);
33
void
DeallocateStack
(uint8_t *buffer, uint32_t stackSize);
34
static
void
Trampoline
(
int
a0,
int
a1,
int
a2,
int
a3);
35
36
37
void (*
m_notifySwitch
)(void);
38
static
void
*
g_alternateSignalStack
;
39
static
std::list<unsigned long>
g_guardPages
;
40
};
41
42
}
// namespace ns3
43
44
#endif
/* UCONTEXT_FIBER_MANAGER_H */
model
ucontext-fiber-manager.h
Generated on Fri Aug 30 2013 13:57:56 for ns-3-dce by
1.8.1.2