Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
E
etherlabmaster
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Jira
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ICS Control System Infrastructure
etherlabmaster
Commits
fd928a65
Commit
fd928a65
authored
19 years ago
by
Florian Pose
Browse files
Options
Downloads
Patches
Plain Diff
Verbesserte Makefiles (MODPOST-Warnungen entfernt).
parent
c522a8a1
No related branches found
No related tags found
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
Makefile
+11
-20
11 additions, 20 deletions
Makefile
drivers/Makefile
+2
-4
2 additions, 4 deletions
drivers/Makefile
rt/msr_module.c
+38
-78
38 additions, 78 deletions
rt/msr_module.c
rt/rt_lib
+0
-1
0 additions, 1 deletion
rt/rt_lib
with
51 additions
and
103 deletions
Makefile
+
11
−
20
View file @
fd928a65
...
@@ -14,26 +14,22 @@ ifeq ($(CONFIG_FILE),$(wildcard $(CONFIG_FILE)))
...
@@ -14,26 +14,22 @@ ifeq ($(CONFIG_FILE),$(wildcard $(CONFIG_FILE)))
include
$(CONFIG_FILE)
include
$(CONFIG_FILE)
endif
endif
#----------------------------------------------------------------
obj-m
:=
drivers/ mini/
all
:
.drivers .rt .mini
ifeq
($(MAKE_RT),yes)
obj-m
+=
rt/
endif
doc docs
:
#----------------------------------------------------------------
doxygen Doxyfile
.drivers
:
all
:
$(
MAKE
)
-C
driver
s
$(
MAKE
)
-C
$(
KERNELDIR
)
M
=
`
pwd
`
module
s
ifeq
($(MAKE_RT),yes)
clean
:
.rt
:
$(
MAKE
)
-C
$(
KERNELDIR
)
M
=
`
pwd
`
clean
$(
MAKE
)
-C
rt
else
.rt
:
@
echo
"Skipping Real-Time."
endif
.mini
:
doc docs
:
$(
MAKE
)
-C
mini
doxygen Doxyfile
config conf $(CONFIG_FILE)
:
config conf $(CONFIG_FILE)
:
@
echo
"# EtherCAT Konfigurationsdatei Kernel 2.6"
>
$(
CONFIG_FILE
)
@
echo
"# EtherCAT Konfigurationsdatei Kernel 2.6"
>
$(
CONFIG_FILE
)
...
@@ -46,9 +42,4 @@ config conf $(CONFIG_FILE):
...
@@ -46,9 +42,4 @@ config conf $(CONFIG_FILE):
@
echo
>>
$(
CONFIG_FILE
)
@
echo
>>
$(
CONFIG_FILE
)
@
echo
"
$(
CONFIG_FILE
)
erstellt."
@
echo
"
$(
CONFIG_FILE
)
erstellt."
clean
:
$(
MAKE
)
-C
rt clean
$(
MAKE
)
-C
drivers clean
$(
MAKE
)
-C
mini clean
#----------------------------------------------------------------
#----------------------------------------------------------------
This diff is collapsed.
Click to expand it.
drivers/Makefile
+
2
−
4
View file @
fd928a65
...
@@ -32,13 +32,11 @@ else
...
@@ -32,13 +32,11 @@ else
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
# Default-Abschnitt
# Default-Abschnitt
include
../ethercat.conf
modules
:
modules
:
$(
MAKE
)
-C
$(
KERNELDIR
)
M
=
`
pwd
`
modules
$(
MAKE
)
-C
..
clean
:
clean
:
$(
MAKE
)
-C
$(
KERNELDIR
)
M
=
`
pwd
`
clean
$(
MAKE
)
-C
..
clean
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
...
...
This diff is collapsed.
Click to expand it.
rt/msr_module.c
+
38
−
78
View file @
fd928a65
...
@@ -19,75 +19,44 @@
...
@@ -19,75 +19,44 @@
*
*
*****************************************************************************/
*****************************************************************************/
#ifndef __KERNEL__
// Linux
# define __KERNEL__
#endif
#ifndef MODULE
# define MODULE
#endif
#include
<linux/config.h>
#include
<linux/module.h>
#include
<linux/module.h>
#include
<linux/sched.h>
#include
<linux/kernel.h>
#include
<linux/vmalloc.h>
#include
<linux/fs.h>
/* everything... */
#include
<linux/proc_fs.h>
#include
<linux/time.h>
#include
<linux/timer.h>
#include
<linux/timex.h>
/* fuer get_cycles */
#include
<linux/errno.h>
/* error codes */
#include
<asm/msr.h>
/* maschine-specific registers */
#include
<linux/param.h>
/* fuer HZ */
#include
<linux/ipipe.h>
#include
<linux/ipipe.h>
#include
"msr_param.h"
//wird im Projektverzeichnis erwartet
// RT_lib
//#include <msr_control.h>
#include
<msr_lists.h>
#include
<msr_charbuf.h>
#include
<msr_reg.h>
#include
<msr_error_reg.h>
#include
<msr_messages.h>
#include
<msr_proc.h>
#include
<msr_utils.h>
#include
<msr_main.h>
#include
<msr_main.h>
#include
<msr_utils.h>
#include
<msr_messages.h>
#include
<msr_float.h>
#include
<msr_float.h>
#include
<msr_reg.h>
#include
"msr_param.h"
#include
"msr_jitter.h"
// EtherCAT
#include
"../drivers/ec_master.h"
#include
"../drivers/ec_master.h"
#include
"../drivers/ec_device.h"
#include
"../drivers/ec_device.h"
#include
"../drivers/ec_types.h"
#include
"../drivers/ec_types.h"
#include
"../drivers/ec_module.h"
#include
"../drivers/ec_module.h"
#include
"msr_jitter.h"
// Defines/Makros
#define TSC2US(T1, T2) ((T2 - T1) * 1000UL / cpu_khz)
#define TSC2US(T) ((unsigned long) (T) * 1000UL / cpu_khz)
/*--external data------------------------------------------------------------*/
#define HZREDUCTION (MSR_ABTASTFREQUENZ/HZ)
#define HZREDUCTION (MSR_ABTASTFREQUENZ/HZ)
extern
wait_queue_head_t
msr_read_waitqueue
;
/*****************************************************************************/
/* Globale Variablen */
extern
struct
msr_char_buf
*
msr_kanal_puffer
;
extern
int
proc_abtastfrequenz
;
/*--local data---------------------------------------------------------------*/
// RT_lib
extern
struct
timeval
process_time
;
extern
struct
timeval
process_time
;
struct
timeval
msr_time_increment
;
// Increment per Interrupt
struct
timeval
msr_time_increment
;
// Increment per Interrupt
//adeos
// Adeos
static
struct
ipipe_domain
this_domain
;
static
struct
ipipe_domain
this_domain
;
static
struct
ipipe_sysinfo
sys_info
;
static
struct
ipipe_sysinfo
sys_info
;
// EtherCAT
static
EtherCAT_master_t
*
ecat_master
=
NULL
;
static
EtherCAT_master_t
*
ecat_master
=
NULL
;
static
unsigned
long
ecat_bus_time
=
0
;
static
EtherCAT_slave_t
ecat_slaves
[]
=
static
EtherCAT_slave_t
ecat_slaves
[]
=
{
{
...
@@ -178,7 +147,6 @@ static int next2004(int *wrap)
...
@@ -178,7 +147,6 @@ static int next2004(int *wrap)
return
-
1
;
return
-
1
;
}
}
/******************************************************************************
/******************************************************************************
*
*
* Function: msr_controller_run()
* Function: msr_controller_run()
...
@@ -256,21 +224,23 @@ static void msr_controller_run(void)
...
@@ -256,21 +224,23 @@ static void msr_controller_run(void)
//EtherCAT_process_data_cycle(ecat_master, 2);
//EtherCAT_process_data_cycle(ecat_master, 2);
rdtscl
(
t7
);
ecat_bus_time
=
TSC2US
(
t2
,
t7
);
// Daten lesen und skalieren
// Daten lesen und skalieren
#ifdef USE_MSR_LIB
#ifdef USE_MSR_LIB
value
=
EtherCAT_read_value
(
&
ecat_slaves
[
5
],
0
)
/
3276
.
0
;
value
=
EtherCAT_read_value
(
&
ecat_slaves
[
5
],
0
)
/
3276
.
0
;
dig1
=
EtherCAT_read_value
(
&
ecat_slaves
[
2
],
0
);
dig1
=
EtherCAT_read_value
(
&
ecat_slaves
[
2
],
0
);
#endif
#endif
rdtscl
(
t7
);
if
(
debug_counter
==
MSR_ABTASTFREQUENZ
)
{
if
(
debug_counter
==
MSR_ABTASTFREQUENZ
)
{
printk
(
KERN_DEBUG
"%lu: %lus + %lus + %lus + %lus + %lus +"
printk
(
KERN_DEBUG
"%lu: %lus + %lus + %lus + %lus + %lus +"
" %lus = %lus (%u %u)
\n
"
,
" %lus = %lus (%u %u)
\n
"
,
TSC2US
(
t1
-
lt
),
TSC2US
(
lt
,
t1
),
TSC2US
(
t
2
-
t
1
),
TSC2US
(
t
3
-
t
2
),
TSC2US
(
t
4
-
t
3
),
TSC2US
(
t
1
,
t
2
),
TSC2US
(
t
2
,
t
3
),
TSC2US
(
t
3
,
t
4
),
TSC2US
(
t
5
-
t
4
),
TSC2US
(
t
6
-
t
5
),
TSC2US
(
t
7
-
t
6
),
TSC2US
(
t
4
,
t
5
),
TSC2US
(
t
5
,
t
6
),
TSC2US
(
t
6
,
t
7
),
TSC2US
(
t
7
-
t
1
),
tr1
,
tr2
);
TSC2US
(
t
1
,
t
7
),
tr1
,
tr2
);
debug_counter
=
0
;
debug_counter
=
0
;
}
}
...
@@ -297,31 +267,25 @@ static void msr_controller_run(void)
...
@@ -297,31 +267,25 @@ static void msr_controller_run(void)
void
msr_run
(
unsigned
irq
)
void
msr_run
(
unsigned
irq
)
{
{
static
int
counter
=
0
;
static
int
counter
=
0
;
#ifdef USE_MSR_LIB
timeval_add
(
&
process_time
,
&
process_time
,
&
msr_time_increment
);
MSR_ADEOS_INTERRUPT_CODE
(
#ifdef USE_MSR_LIB
msr_controller_run
();
timeval_add
(
&
process_time
,
&
process_time
,
&
msr_time_increment
);
msr_write_kanal_list
();
MSR_ADEOS_INTERRUPT_CODE
(
msr_controller_run
();
msr_write_kanal_list
(););
);
#else
#else
msr_controller_run
();
msr_controller_run
();
#endif
#endif
/* und wieder in die Timerliste eintragen */
/* und neu in die Taskqueue eintragen */
//timer.expires += 1;
//add_timer(&timer);
ipipe_control_irq
(
irq
,
0
,
IPIPE_ENABLE_MASK
);
//Interrupt besttigen
ipipe_control_irq
(
irq
,
0
,
IPIPE_ENABLE_MASK
);
//Interrupt besttigen
if
(
counter
++
>
HZREDUCTION
)
{
if
(
counter
++
>
HZREDUCTION
)
{
ipipe_propagate_irq
(
irq
);
//und weiterreichen
ipipe_propagate_irq
(
irq
);
//und weiterreichen
counter
=
0
;
counter
=
0
;
}
}
}
}
void
domain_entry
(
void
)
/*****************************************************************************/
void
domain_entry
(
void
)
{
{
printk
(
"Domain %s started.
\n
"
,
ipipe_current_domain
->
name
);
printk
(
"Domain %s started.
\n
"
,
ipipe_current_domain
->
name
);
...
@@ -352,14 +316,10 @@ int msr_globals_register(void)
...
@@ -352,14 +316,10 @@ int msr_globals_register(void)
msr_reg_kanal
(
"/value"
,
"V"
,
&
value
,
TDBL
);
msr_reg_kanal
(
"/value"
,
"V"
,
&
value
,
TDBL
);
msr_reg_kanal
(
"/dig1"
,
""
,
&
dig1
,
TINT
);
msr_reg_kanal
(
"/dig1"
,
""
,
&
dig1
,
TINT
);
#endif
#endif
#if 0
msr_reg_kanal("/Taskinfo/Ecat/TX-Delay","us",&ecat_tx_delay,TUINT);
msr_reg_kanal
(
"/Taskinfo/EtherCAT/BusTime"
,
"us"
,
&
ecat_bus_time
,
TUINT
);
msr_reg_kanal("/Taskinfo/Ecat/RX-Delay","us",&ecat_rx_delay,TUINT);
msr_reg_kanal("/Taskinfo/Ecat/TX-Cnt","",&tx_intr,TUINT);
return
0
;
msr_reg_kanal("/Taskinfo/Ecat/RX-Cnt","",&rx_intr,TUINT);
msr_reg_kanal("/Taskinfo/Ecat/Total-Cnt","",&total_intr,TUINT);
#endif
return
0
;
}
}
/******************************************************************************
/******************************************************************************
...
@@ -434,7 +394,7 @@ void __exit cleanup_module()
...
@@ -434,7 +394,7 @@ void __exit cleanup_module()
msr_print_info
(
"msk_modul: unloading..."
);
msr_print_info
(
"msk_modul: unloading..."
);
ipipe_tune_timer
(
1000000000UL
/
HZ
,
0
);
//alten Timertakt wieder herstellen
ipipe_tune_timer
(
1000000000UL
/
HZ
,
0
);
//alten Timertakt wieder herstellen
ipipe_unregister_domain
(
&
this_domain
);
ipipe_unregister_domain
(
&
this_domain
);
if
(
ecat_master
)
if
(
ecat_master
)
...
...
This diff is collapsed.
Click to expand it.
rt/rt_lib
deleted
120000 → 0
+
0
−
1
View file @
c522a8a1
../../../linux/kernel_space/rt_lib-4.0.0-2.6krnl
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment