Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
proview
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Esteban Blanc
proview
Commits
e6374e07
Commit
e6374e07
authored
May 18, 2007
by
claes
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added i/o swap-method to avoid stall during warm restart
parent
a8395fd3
Changes
8
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
700 additions
and
332 deletions
+700
-332
src/lib/rt/src/rt_io_base.c
src/lib/rt/src/rt_io_base.c
+517
-324
src/lib/rt/src/rt_io_base.h
src/lib/rt/src/rt_io_base.h
+18
-2
src/lib/rt/src/rt_io_m_node.c
src/lib/rt/src/rt_io_m_node.c
+11
-1
src/wbl/pwrs/src/pwrs_c_node.wb_load
src/wbl/pwrs/src/pwrs_c_node.wb_load
+6
-1
ssabox/lib/rt/src/os_linux/rt_io_m_rack_ssab.c
ssabox/lib/rt/src/os_linux/rt_io_m_rack_ssab.c
+27
-1
ssabox/lib/rt/src/os_linux/rt_io_m_ssab_do.c
ssabox/lib/rt/src/os_linux/rt_io_m_ssab_do.c
+50
-1
ssabox/lib/rt/src/os_linux/rt_io_m_ssab_remoterack.c
ssabox/lib/rt/src/os_linux/rt_io_m_ssab_remoterack.c
+60
-1
ssabox/wbl/mcomp/src/ssabox.wb_load
ssabox/wbl/mcomp/src/ssabox.wb_load
+11
-1
No files found.
src/lib/rt/src/rt_io_base.c
View file @
e6374e07
This diff is collapsed.
Click to expand it.
src/lib/rt/src/rt_io_base.h
View file @
e6374e07
/*
/*
* Proview $Id: rt_io_base.h,v 1.
8 2006-06-30 12:17
:12 claes Exp $
* Proview $Id: rt_io_base.h,v 1.
9 2007-05-18 12:05
:12 claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
* Copyright (C) 2005 SSAB Oxelsund AB.
*
*
* This program is free software; you can redistribute it and/or
* This program is free software; you can redistribute it and/or
...
@@ -68,7 +68,8 @@ typedef enum {
...
@@ -68,7 +68,8 @@ typedef enum {
typedef
enum
{
typedef
enum
{
io_mAction_None
=
0
,
io_mAction_None
=
0
,
io_mAction_Read
=
1
<<
0
,
io_mAction_Read
=
1
<<
0
,
io_mAction_Write
=
1
<<
1
io_mAction_Write
=
1
<<
1
,
io_mAction_Swap
=
1
<<
2
}
io_mAction
;
}
io_mAction
;
typedef
enum
{
typedef
enum
{
...
@@ -107,6 +108,7 @@ typedef struct s_Card {
...
@@ -107,6 +108,7 @@ typedef struct s_Card {
pwr_tStatus
(
*
Close
)
();
/* Close method */
pwr_tStatus
(
*
Close
)
();
/* Close method */
pwr_tStatus
(
*
Read
)
();
/* Read method */
pwr_tStatus
(
*
Read
)
();
/* Read method */
pwr_tStatus
(
*
Write
)
();
/* Write method */
pwr_tStatus
(
*
Write
)
();
/* Write method */
pwr_tStatus
(
*
Swap
)
();
/* Write method */
pwr_tAddress
*
op
;
/* Pointer to card object */
pwr_tAddress
*
op
;
/* Pointer to card object */
pwr_tDlid
Dlid
;
/* Dlid for card object pointer */
pwr_tDlid
Dlid
;
/* Dlid for card object pointer */
pwr_tUInt32
size
;
/* Size of card data area in byte */
pwr_tUInt32
size
;
/* Size of card data area in byte */
...
@@ -130,6 +132,7 @@ typedef struct s_Rack {
...
@@ -130,6 +132,7 @@ typedef struct s_Rack {
pwr_tStatus
(
*
Close
)
();
/* Close method */
pwr_tStatus
(
*
Close
)
();
/* Close method */
pwr_tStatus
(
*
Read
)
();
/* Read method */
pwr_tStatus
(
*
Read
)
();
/* Read method */
pwr_tStatus
(
*
Write
)
();
/* Write method */
pwr_tStatus
(
*
Write
)
();
/* Write method */
pwr_tStatus
(
*
Swap
)
();
/* Swap method */
void
*
op
;
/* Pointer to rack object */
void
*
op
;
/* Pointer to rack object */
pwr_tDlid
Dlid
;
/* Dlid fr rack object pointer */
pwr_tDlid
Dlid
;
/* Dlid fr rack object pointer */
pwr_tUInt32
size
;
/* Size of rack data area in byte */
pwr_tUInt32
size
;
/* Size of rack data area in byte */
...
@@ -152,6 +155,7 @@ typedef struct s_Agent {
...
@@ -152,6 +155,7 @@ typedef struct s_Agent {
pwr_tStatus
(
*
Close
)
();
/* Close method */
pwr_tStatus
(
*
Close
)
();
/* Close method */
pwr_tStatus
(
*
Read
)
();
/* Read method */
pwr_tStatus
(
*
Read
)
();
/* Read method */
pwr_tStatus
(
*
Write
)
();
/* Write method */
pwr_tStatus
(
*
Write
)
();
/* Write method */
pwr_tStatus
(
*
Swap
)
();
/* Write method */
void
*
op
;
/* Pointer to agent object */
void
*
op
;
/* Pointer to agent object */
pwr_tDlid
Dlid
;
/* Dlid for agent object pointer */
pwr_tDlid
Dlid
;
/* Dlid for agent object pointer */
int
scan_interval
;
/* Interval between scans */
int
scan_interval
;
/* Interval between scans */
...
@@ -197,6 +201,14 @@ pwr_tStatus io_init(
...
@@ -197,6 +201,14 @@ pwr_tStatus io_init(
float
scan_time
float
scan_time
);
);
pwr_tStatus
io_init_swap
(
io_mProcess
process
,
pwr_tObjid
thread
,
io_tCtx
*
ctx
,
int
relativ_vector
,
float
scan_time
);
pwr_tStatus
io_read
(
pwr_tStatus
io_read
(
io_tCtx
ctx
io_tCtx
ctx
);
);
...
@@ -205,6 +217,10 @@ pwr_tStatus io_write(
...
@@ -205,6 +217,10 @@ pwr_tStatus io_write(
io_tCtx
ctx
io_tCtx
ctx
);
);
pwr_tStatus
io_swap
(
io_tCtx
ctx
);
pwr_tStatus
io_close
(
pwr_tStatus
io_close
(
io_tCtx
ctx
io_tCtx
ctx
);
);
...
...
src/lib/rt/src/rt_io_m_node.c
View file @
e6374e07
/*
/*
* Proview $Id: rt_io_m_node.c,v 1.
2 2005-09-01 14:57:55
claes Exp $
* Proview $Id: rt_io_m_node.c,v 1.
3 2007-05-18 12:05:12
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
* Copyright (C) 2005 SSAB Oxelsund AB.
*
*
* This program is free software; you can redistribute it and/or
* This program is free software; you can redistribute it and/or
...
@@ -40,6 +40,15 @@ static pwr_tStatus IoAgentInit (
...
@@ -40,6 +40,15 @@ static pwr_tStatus IoAgentInit (
return
1
;
return
1
;
}
}
static
pwr_tStatus
IoAgentSwap
(
io_tCtx
ctx
,
io_sAgent
*
ap
)
{
return
1
;
}
/*----------------------------------------------------------------------------*\
/*----------------------------------------------------------------------------*\
...
@@ -52,5 +61,6 @@ static pwr_tStatus IoAgentInit (
...
@@ -52,5 +61,6 @@ static pwr_tStatus IoAgentInit (
pwr_dExport
pwr_BindIoMethods
(
Node
)
=
{
pwr_dExport
pwr_BindIoMethods
(
Node
)
=
{
pwr_BindIoMethod
(
IoAgentInit
),
pwr_BindIoMethod
(
IoAgentInit
),
pwr_BindIoMethod
(
IoAgentSwap
),
pwr_NullMethod
pwr_NullMethod
};
};
src/wbl/pwrs/src/pwrs_c_node.wb_load
View file @
e6374e07
!
!
! Proview $Id: pwrs_c_node.wb_load,v 1.1
1 2006-03-31 14:47:1
5 claes Exp $
! Proview $Id: pwrs_c_node.wb_load,v 1.1
2 2007-05-18 12:06:0
5 claes Exp $
! Copyright (C) 2005 SSAB Oxelsund AB.
! Copyright (C) 2005 SSAB Oxelsund AB.
!
!
! This program is free software; you can redistribute it and/or
! This program is free software; you can redistribute it and/or
...
@@ -344,6 +344,11 @@ SObject pwrs:Class
...
@@ -344,6 +344,11 @@ SObject pwrs:Class
Attr MethodName = "Node-IoAgentInit"
Attr MethodName = "Node-IoAgentInit"
EndBody
EndBody
EndObject
EndObject
Object IoAgentSwap $Method
Body SysBody
Attr MethodName = "Node-IoAgentSwap"
EndBody
EndObject
EndObject
EndObject
EndObject
EndObject
EndSObject
EndSObject
ssabox/lib/rt/src/os_linux/rt_io_m_rack_ssab.c
View file @
e6374e07
/*
/*
* Proview $Id: rt_io_m_rack_ssab.c,v 1.
2 2006-04-12 10:14:49
claes Exp $
* Proview $Id: rt_io_m_rack_ssab.c,v 1.
3 2007-05-18 12:06:05
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
* Copyright (C) 2005 SSAB Oxelsund AB.
*
*
* This program is free software; you can redistribute it and/or
* This program is free software; you can redistribute it and/or
...
@@ -64,6 +64,31 @@ static pwr_tStatus IoRackInit (
...
@@ -64,6 +64,31 @@ static pwr_tStatus IoRackInit (
return
1
;
return
1
;
}
}
static
pwr_tStatus
IoRackSwap
(
io_tCtx
ctx
,
io_sAgent
*
ap
,
io_sRack
*
rp
)
{
io_sRackLocal
*
local
;
if
(
!
rp
->
Local
)
{
/* Open Qbus driver */
local
=
calloc
(
1
,
sizeof
(
*
local
));
rp
->
Local
=
local
;
local
->
Qbus_fp
=
open
(
"/dev/qbus"
,
O_RDWR
);
if
(
local
->
Qbus_fp
==
-
1
)
{
errh_Error
(
"Qbus swap initialization error, IO rack %s"
,
rp
->
Name
);
return
IO__ERRDEVICE
;
}
errh_Info
(
"Swap init of IO rack %s"
,
rp
->
Name
);
}
return
1
;
}
static
pwr_tStatus
IoRackClose
(
static
pwr_tStatus
IoRackClose
(
io_tCtx
ctx
,
io_tCtx
ctx
,
io_sAgent
*
ap
,
io_sAgent
*
ap
,
...
@@ -93,6 +118,7 @@ static pwr_tStatus IoRackClose (
...
@@ -93,6 +118,7 @@ static pwr_tStatus IoRackClose (
pwr_dExport
pwr_BindIoMethods
(
Rack_SSAB
)
=
{
pwr_dExport
pwr_BindIoMethods
(
Rack_SSAB
)
=
{
pwr_BindIoMethod
(
IoRackInit
),
pwr_BindIoMethod
(
IoRackInit
),
pwr_BindIoMethod
(
IoRackSwap
),
pwr_BindIoMethod
(
IoRackClose
),
pwr_BindIoMethod
(
IoRackClose
),
pwr_NullMethod
pwr_NullMethod
};
};
ssabox/lib/rt/src/os_linux/rt_io_m_ssab_do.c
View file @
e6374e07
/*
/*
* Proview $Id: rt_io_m_ssab_do.c,v 1.
4 2007-04-30 12:08:08
claes Exp $
* Proview $Id: rt_io_m_ssab_do.c,v 1.
5 2007-05-18 12:06:05
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
* Copyright (C) 2005 SSAB Oxelsund AB.
*
*
* This program is free software; you can redistribute it and/or
* This program is free software; you can redistribute it and/or
...
@@ -250,6 +250,54 @@ static pwr_tStatus IoCardWrite (
...
@@ -250,6 +250,54 @@ static pwr_tStatus IoCardWrite (
return
1
;
return
1
;
}
}
/*----------------------------------------------------------------------------*\
\*----------------------------------------------------------------------------*/
static
pwr_tStatus
IoCardSwap
(
io_tCtx
ctx
,
io_sAgent
*
ap
,
io_sRack
*
rp
,
io_sCard
*
cp
)
{
io_sLocal
*
local
;
io_sRackLocal
*
r_local
=
(
io_sRackLocal
*
)(
rp
->
Local
);
pwr_tUInt16
data
=
0
;
pwr_sClass_Ssab_BaseDoCard
*
op
;
int
i
;
qbus_io_read
rb
;
int
sts
;
if
(
!
cp
->
Local
)
{
local
=
calloc
(
1
,
sizeof
(
*
local
));
cp
->
Local
=
local
;
local
->
Address
[
0
]
=
op
->
RegAddress
;
local
->
Address
[
1
]
=
op
->
RegAddress
+
2
;
local
->
Qbus_fp
=
((
io_sRackLocal
*
)(
rp
->
Local
))
->
Qbus_fp
;
}
op
=
(
pwr_sClass_Ssab_BaseDoCard
*
)
cp
->
op
;
for
(
i
=
0
;
i
<
2
;
i
++
)
{
if
(
r_local
->
Qbus_fp
!=
0
&&
r_local
->
s
==
0
)
{
/* Write to local Q-bus */
rb
.
Address
=
local
->
Address
[
i
];
sts
=
read
(
local
->
Qbus_fp
,
&
rb
,
sizeof
(
rb
));
}
else
{
/* Ethernet I/O, Get data from current address */
data
=
bfbeth_get_data
(
r_local
,
(
pwr_tUInt16
)
local
->
Address
[
i
],
&
sts
);
/* Yes, we want to read this address the next time aswell */
bfbeth_set_read_req
(
r_local
,
(
pwr_tUInt16
)
local
->
Address
[
i
]);
sts
=
1
;
}
}
return
1
;
}
/*----------------------------------------------------------------------------*\
/*----------------------------------------------------------------------------*\
Every method to be exported to the workbench should be registred here.
Every method to be exported to the workbench should be registred here.
...
@@ -259,5 +307,6 @@ pwr_dExport pwr_BindIoMethods(Ssab_Do) = {
...
@@ -259,5 +307,6 @@ pwr_dExport pwr_BindIoMethods(Ssab_Do) = {
pwr_BindIoMethod
(
IoCardInit
),
pwr_BindIoMethod
(
IoCardInit
),
pwr_BindIoMethod
(
IoCardClose
),
pwr_BindIoMethod
(
IoCardClose
),
pwr_BindIoMethod
(
IoCardWrite
),
pwr_BindIoMethod
(
IoCardWrite
),
pwr_BindIoMethod
(
IoCardSwap
),
pwr_NullMethod
pwr_NullMethod
};
};
ssabox/lib/rt/src/os_linux/rt_io_m_ssab_remoterack.c
View file @
e6374e07
/*
/*
* Proview $Id: rt_io_m_ssab_remoterack.c,v 1.
5 2006-09-05 12:03:01
claes Exp $
* Proview $Id: rt_io_m_ssab_remoterack.c,v 1.
6 2007-05-18 12:06:05
claes Exp $
* Copyright (C) 2005 SSAB Oxelsund AB.
* Copyright (C) 2005 SSAB Oxelsund AB.
*
*
* This program is free software; you can redistribute it and/or
* This program is free software; you can redistribute it and/or
...
@@ -134,6 +134,64 @@ static pwr_tStatus IoRackInit (
...
@@ -134,6 +134,64 @@ static pwr_tStatus IoRackInit (
return
IO__SUCCESS
;
return
IO__SUCCESS
;
}
}
static
pwr_tStatus
IoRackSwap
(
io_tCtx
ctx
,
io_sAgent
*
ap
,
io_sRack
*
rp
)
{
io_sRackLocal
*
local
;
pwr_sClass_Ssab_RemoteRack
*
op
;
int
sts
;
fd_set
fds
;
struct
timeval
tv
;
struct
bfb_buf
rbuf
;
int
size
;
if
(
!
rp
->
Local
)
{
sts
=
IoRackInit
(
ctx
,
ap
,
rp
);
if
(
sts
!=
IO__SUCCESS
)
return
IO__ERRINIDEVICE
;
}
local
=
(
io_sRackLocal
*
)
rp
->
Local
;
op
=
(
pwr_sClass_Ssab_RemoteRack
*
)
rp
->
op
;
// Calc length and send read request
local
->
read_req
.
service
=
BFB_SERVICE_READ
;
local
->
read_req
.
length
=
local
->
next_read_req_item
*
4
+
4
;
sts
=
send
(
local
->
s
,
&
local
->
read_req
,
local
->
read_req
.
length
,
0
);
op
->
TX_packets
++
;
local
->
next_read_req_item
=
0
;
bzero
(
&
local
->
read_area
,
sizeof
(
local
->
read_area
));
sts
=
1
;
while
(
sts
>
0
)
{
FD_ZERO
(
&
fds
);
FD_SET
(
local
->
s
,
&
fds
);
tv
.
tv_sec
=
0
;
tv
.
tv_usec
=
0
;
sts
=
select
(
32
,
&
fds
,
NULL
,
NULL
,
&
tv
);
if
(
sts
>
0
)
{
size
=
recv
(
local
->
s
,
&
rbuf
,
sizeof
(
rbuf
),
0
);
if
(
rbuf
.
service
==
BFB_SERVICE_READ
)
{
bzero
(
&
local
->
read_area
,
sizeof
(
local
->
read_area
));
memcpy
(
&
local
->
read_area
,
&
rbuf
,
size
);
}
else
if
(
rbuf
.
service
==
BFB_SERVICE_WRITE
)
{
bzero
(
&
local
->
write_area
,
sizeof
(
local
->
write_area
));
memcpy
(
&
local
->
write_area
,
&
rbuf
,
size
);
}
op
->
RX_packets
++
;
}
}
return
IO__SUCCESS
;
}
static
pwr_tStatus
IoRackClose
(
static
pwr_tStatus
IoRackClose
(
io_tCtx
ctx
,
io_tCtx
ctx
,
io_sAgent
*
ap
,
io_sAgent
*
ap
,
...
@@ -223,6 +281,7 @@ static pwr_tStatus IoRackWrite (
...
@@ -223,6 +281,7 @@ static pwr_tStatus IoRackWrite (
pwr_dExport
pwr_BindIoMethods
(
Ssab_RemoteRack
)
=
{
pwr_dExport
pwr_BindIoMethods
(
Ssab_RemoteRack
)
=
{
pwr_BindIoMethod
(
IoRackInit
),
pwr_BindIoMethod
(
IoRackInit
),
pwr_BindIoMethod
(
IoRackSwap
),
pwr_BindIoMethod
(
IoRackClose
),
pwr_BindIoMethod
(
IoRackClose
),
pwr_BindIoMethod
(
IoRackRead
),
pwr_BindIoMethod
(
IoRackRead
),
pwr_BindIoMethod
(
IoRackWrite
),
pwr_BindIoMethod
(
IoRackWrite
),
...
...
ssabox/wbl/mcomp/src/ssabox.wb_load
View file @
e6374e07
Volume SsabOx $ClassVolume 0.0.250.5
Volume SsabOx $ClassVolume 0.0.250.5
Body SysBody 01-JAN-1970 01:00:00.00
Body SysBody 01-JAN-1970 01:00:00.00
Attr NextOix = "_X16
0
"
Attr NextOix = "_X16
2
"
Attr NextCix = "_X30"
Attr NextCix = "_X30"
Attr NextTix[0] = "_X5"
Attr NextTix[0] = "_X5"
EndBody
EndBody
...
@@ -145,6 +145,11 @@ Volume SsabOx $ClassVolume 0.0.250.5
...
@@ -145,6 +145,11 @@ Volume SsabOx $ClassVolume 0.0.250.5
Attr MethodName = "Rack_SSAB-IoRackClose"
Attr MethodName = "Rack_SSAB-IoRackClose"
EndBody
EndBody
EndObject
EndObject
Object IoRackSwap $Method 161 18-MAY-2007 10:19:42.40
Body SysBody 18-MAY-2007 10:19:47.20
Attr MethodName = "Rack_SSAB-IoRackSwap"
EndBody
EndObject
EndObject
EndObject
Object Template Rack_SSAB 2154004480 01-JAN-1970 01:00:00.00
Object Template Rack_SSAB 2154004480 01-JAN-1970 01:00:00.00
Body RtBody 30-DEC-2005 14:46:17.32
Body RtBody 30-DEC-2005 14:46:17.32
...
@@ -3815,6 +3820,11 @@ Volume SsabOx $ClassVolume 0.0.250.5
...
@@ -3815,6 +3820,11 @@ Volume SsabOx $ClassVolume 0.0.250.5
Attr MethodName = "Ssab_Do-IoCardWrite"
Attr MethodName = "Ssab_Do-IoCardWrite"
EndBody
EndBody
EndObject
EndObject
Object IoCardSwap $Method 162 18-MAY-2007 10:20:35.84
Body SysBody 18-MAY-2007 10:20:39.25
Attr MethodName = "Ssab_Do-IoCardSwap"
EndBody
EndObject
EndObject
EndObject
EndObject
EndObject
!/**
!/**
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment