[PATCH 2/2] libmisc/capture: Removal all use of the reserved _t in types.

2016-08-30 Thread Chris Johns
---
 cpukit/libmisc/capture/capture-cli.c|  82 ++---
 cpukit/libmisc/capture/capture.c| 148 +++-
 cpukit/libmisc/capture/capture.h| 139 +++---
 cpukit/libmisc/capture/capture_buffer.c |  10 +-
 cpukit/libmisc/capture/capture_buffer.h |  22 ++--
 cpukit/libmisc/capture/capture_support.c|  62 +-
 cpukit/libmisc/capture/capture_user_extension.c |  46 
 cpukit/libmisc/capture/captureimpl.h|  22 ++--
 8 files changed, 256 insertions(+), 275 deletions(-)

diff --git a/cpukit/libmisc/capture/capture-cli.c 
b/cpukit/libmisc/capture/capture-cli.c
index d2ee383..05c922b 100644
--- a/cpukit/libmisc/capture/capture-cli.c
+++ b/cpukit/libmisc/capture/capture-cli.c
@@ -111,7 +111,7 @@ rtems_capture_cli_open (int
argc,
   if (!enable)
 return;
 
-  sc = rtems_capture_control (enable);
+  sc = rtems_capture_set_control (enable);
 
   if (sc != RTEMS_SUCCESSFUL)
   {
@@ -161,7 +161,7 @@ rtems_capture_cli_enable (int   
 argc RC_UNUSED,
 {
   rtems_status_code sc;
 
-  sc = rtems_capture_control (true);
+  sc = rtems_capture_set_control (true);
 
   if (sc != RTEMS_SUCCESSFUL)
   {
@@ -186,7 +186,7 @@ rtems_capture_cli_disable (int  
  argc RC_UNUSED,
 {
   rtems_status_code sc;
 
-  sc = rtems_capture_control (false);
+  sc = rtems_capture_set_control (false);
 
   if (sc != RTEMS_SUCCESSFUL)
   {
@@ -270,9 +270,9 @@ rtems_capture_cli_task_list (int
argc RC_UNUSED,
  const rtems_monitor_command_arg_t* command_arg 
RC_UNUSED,
  bool   verbose 
RC_UNUSED)
 {
-  rtems_capture_time_t  uptime;
+  rtems_capture_time uptime;
 
-  rtems_capture_time (&uptime);
+  rtems_capture_get_time (&uptime);
 
   rtems_capture_cli_task_count = 0;
   rtems_iterate_over_all_threads (rtems_capture_cli_count_tasks);
@@ -710,14 +710,14 @@ static char const *trigger_set_types =
 /*
  * Structure to handle the parsing of the trigger command line.
  */
-typedef struct rtems_capture_cli_triggers_s
+typedef struct rtems_capture_cli_triggers
 {
-  char const *name;
-  rtems_capture_trigger_t type;
-  int to_only;
-} rtems_capture_cli_triggers_t;
+  char const *  name;
+  rtems_capture_trigger type;
+  int   to_only;
+} rtems_capture_cli_triggers;
 
-static rtems_capture_cli_triggers_t rtems_capture_cli_triggers[] =
+static const rtems_capture_cli_triggers rtems_capture_cli_trigger[] =
 {
   { "switch",  rtems_capture_switch,  0 }, /* must be first */
   { "create",  rtems_capture_create,  0 },
@@ -728,39 +728,39 @@ static rtems_capture_cli_triggers_t 
rtems_capture_cli_triggers[] =
   { "exitted", rtems_capture_exitted, 1 }
 };
 
-typedef enum rtems_capture_cli_trig_state_e
+typedef enum rtems_capture_cli_trig_state
 {
   trig_type,
   trig_to,
   trig_from_from,
   trig_from
-} rtems_capture_cli_trig_state_t;
+} rtems_capture_cli_trig_state;
 
 #define RTEMS_CAPTURE_CLI_TRIGGERS_NUM \
-  (sizeof (rtems_capture_cli_triggers) / sizeof (rtems_capture_cli_triggers_t))
+  (sizeof (rtems_capture_cli_trigger) / sizeof (rtems_capture_cli_triggers))
 
 static void
 rtems_capture_cli_trigger_worker (int set, int argc, char** argv)
 {
-  rtems_status_codesc;
-  int  arg;
-  int  trigger = 0; /* switch */
-  rtems_capture_trigger_mode_t trigger_mode = rtems_capture_from_any;
-  bool trigger_set = false;
-  bool is_from = false;
-  bool is_to = false;
-  rtems_name   name = 0;
-  rtems_id id = 0;
-  bool valid_name = false;
-  bool valid_id = false;
-  rtems_name   from_name = 0;
-  rtems_id from_id = 0;
-  bool from_valid_name = false;
-  bool from_valid_id = false;
-  rtems_name   to_name = 0;
-  rtems_id to_id = 0;
-  bool to_valid_name = false;
-  bool to_valid_id = false;
+  rtems_status_code  sc;
+  intarg;
+  inttrigger = 0; /* switch */
+  rtems_capture_trigger_mode trigger_mode = rtems_capture_from_any;
+  bool   trigger_set = false;
+  bool   is_from = false;
+  bool   is_to = false;
+  rtems_name name = 0;
+  rtems_id   id = 0;
+  bool   valid_name = false;
+  bool   valid_id = false;
+  rtems_name from_name = 0;
+  rtems_id   from_id = 0;
+  bool   

[PATCH 1/2] libmisc/capture: Fix the capture engine on SMP.

2016-08-30 Thread Chris Johns
This patches some issues with the capture engine:

 1. Check is the engine is open in ctrace commands.
 2. Check all record open and appends for overflow.
 3. Fix the record open to take the size of user data and
not the record header.
 4. Use packed structs for data being written to the per
cpu buffers.
 5. Remove direct struct access to the capture buffers to
avoid misaligned accesses.
 6. Add support to extract records, no struct access to the
capture buffers.
 7. Update ctrace to extract records from the capture buffers.
 8. Add support to ctrace to always print the task name if it
has one.
 9. Add support to manage names or the lack of a name.
10. Range of minor fixes.
11. Fix a long standing bug in ctset's handling of args.

Closes #2780.
---
 cpukit/libmisc/capture/capture-cli.c|  51 +--
 cpukit/libmisc/capture/capture-cli.h|   5 +-
 cpukit/libmisc/capture/capture.c| 475 +---
 cpukit/libmisc/capture/capture.h| 257 ++---
 cpukit/libmisc/capture/capture_buffer.c | 164 
 cpukit/libmisc/capture/capture_buffer.h |  69 ++--
 cpukit/libmisc/capture/capture_support.c| 258 +
 cpukit/libmisc/capture/capture_user_extension.c |  23 +-
 cpukit/libmisc/capture/captureimpl.h| 177 +
 9 files changed, 817 insertions(+), 662 deletions(-)

diff --git a/cpukit/libmisc/capture/capture-cli.c 
b/cpukit/libmisc/capture/capture-cli.c
index b9c2edc..d2ee383 100644
--- a/cpukit/libmisc/capture/capture-cli.c
+++ b/cpukit/libmisc/capture/capture-cli.c
@@ -204,14 +204,22 @@ rtems_capture_cli_print_task (rtems_tcb *tcb)
   rtems_task_priority   floor = rtems_capture_watch_get_floor ();
   rtems_task_priority   priority;
   int   length;
+  uint32_t  flags = rtems_capture_task_control_flags (tcb);
 
   priority = rtems_capture_task_real_priority (tcb);
 
   fprintf (stdout, " ");
   rtems_monitor_dump_id (rtems_capture_task_id (tcb));
   fprintf (stdout, " ");
-  rtems_monitor_dump_name (rtems_capture_task_id (tcb));
-  fprintf (stdout, " ");
+  if (rtems_capture_task_api (rtems_capture_task_id (tcb)) != 
OBJECTS_POSIX_API)
+  {
+rtems_monitor_dump_name (rtems_capture_task_id (tcb));
+fprintf (stdout, " ");
+  }
+  else
+  {
+fprintf (stdout, " ");
+  }
   rtems_monitor_dump_priority (rtems_capture_task_start_priority (tcb));
   fprintf (stdout, " ");
   rtems_monitor_dump_priority (rtems_capture_task_real_priority (tcb));
@@ -222,13 +230,12 @@ rtems_capture_cli_print_task (rtems_tcb *tcb)
   fprintf (stdout, "%*c", 14 - length, ' ');
   fprintf (stdout, " %c%c",
'a',
-   rtems_capture_task_flags (tcb) & RTEMS_CAPTURE_TRACED ? 't' : '-');
+   flags & RTEMS_CAPTURE_TRACED ? 't' : '-');
 
   if ((floor > ceiling) && (ceiling > priority))
 fprintf (stdout, "--");
   else
   {
-uint32_t flags = rtems_capture_task_control_flags (tcb);
 fprintf (stdout, "%c%c",
  rtems_capture_task_control (tcb) ?
  (flags & RTEMS_CAPTURE_WATCH ? 'w' : '+') : '-',
@@ -795,7 +802,7 @@ rtems_capture_cli_trigger_worker (int set, int argc, char** 
argv)
   continue;
   }
 
-  if (strcmp (arg[argv], "from") == 0)
+  if (strcmp (argv[arg], "from") == 0)
   {
 if (from_valid_name || from_valid_id)
   fprintf (stdout, "warning: extra 'from' ignored\n");
@@ -804,7 +811,7 @@ rtems_capture_cli_trigger_worker (int set, int argc, char** 
argv)
 continue;
   }
 
-  if (strcmp (arg[argv], "to") == 0)
+  if (strcmp (argv[arg], "to") == 0)
   {
 if (to_valid_name || from_valid_id)
   fprintf (stdout, "warning: extra 'to' ignored\n");
@@ -1040,7 +1047,7 @@ static rtems_monitor_command_entry_t 
rtems_capture_cli_cmds[] =
 {
   {
 "copen",
-"usage: copen [-i] size\n",
+"usage: copen [-i] size",
 0,
 rtems_capture_cli_open,
 { 0 },
@@ -1048,7 +1055,7 @@ static rtems_monitor_command_entry_t 
rtems_capture_cli_cmds[] =
   },
   {
 "cclose",
-"usage: cclose\n",
+"usage: cclose",
 0,
 rtems_capture_cli_close,
 { 0 },
@@ -1056,7 +1063,7 @@ static rtems_monitor_command_entry_t 
rtems_capture_cli_cmds[] =
   },
   {
 "cenable",
-"usage: cenable\n",
+"usage: cenable",
 0,
 rtems_capture_cli_enable,
 { 0 },
@@ -1064,7 +1071,7 @@ static rtems_monitor_command_entry_t 
rtems_capture_cli_cmds[] =
   },
   {
 "cdisable",
-"usage: cdisable\n",
+"usage: cdisable",
 0,
 rtems_capture_cli_disable,
 { 0 },
@@ -1072,7 +1079,7 @@ static rtems_monitor_command_entry_t 
rtems_capture_cli_cmds[] =
   },
   {
 "ctlist",
-"usage: ctlist \n",
+"usage: ctlist",
 0,
  rtems_capture_cli_task_list,
 { 0 },
@@ -1080,7 +1087,7 @@ static rtems_monitor_command_entry_t 
rtems_capture_cli_cmds[] =
   },
   {
 "cwlist",
-"usage: cwlist\n

Flight Software Abstracts Due September 19

2016-08-30 Thread Joel Sherrill
This is a reminder that the deadline for submission of abstracts to the 2016
Flight Software Workshop is **Monday, September 19th**. Thank you to
those of you
who have already submitted abstracts. Those of you who haven't yet done so can
submit using this link:

Submit Abstract




CFS Community Workshop and FSW-16 will take place December 12-15, 2016 at the
Beckman Institute at the California Institute of Technology, with support from
the NASA Jet Propulsion Laboratory, The Aerospace Corporation and The Johns
Hopkins University Applied Physics Laboratory.

This workshop is an opportunity to present current flight architectures, new
approaches to mission solutions, and techniques for flight software
development,
integration, test and verification in an informal setting that encourages
communication among organizations and agencies. The following is a list of
potential subject areas:

  * Flight software engineering and testing
  * Autonomy
  * Model based software development
  * Navigation, fault management, and command sequence control
  * On-board communication
  * Space network protocols
  * On-board data processing
  * Software modeling, simulation and testbeds
  * Spacecraft software architectures
  * Agile software development
  * Flight processors and operating systems
  * Planning, tasking and execution
  * Systems engineering
  * Software Verification and Validation
  * Testing Technologies
  * Lessons learned


This is a *presentation only*workshop. Presentations must not contain US Export
Controlled information (aka ITAR), and notice of this must be indicated on all
presentations. All abstracts and presentations must be ready for
public release.
Authors are advised to download the recording release form

and
electronic release form

and
review those with the legal experts in their organization.

FSW-2016 Organizing Committee
Flight Software Workshop





Flight Software
Workshop,11101 Johns Hopkins Road,Embedded Flight Software Group,
Space Department,Bldg 200 - W430, Laurel, MD 20723
SafeUnsubscribeâ„¢ joel.sherr...@oarcorp.com



Forward this email


| Update Profile


|
About our service provider



Sent by space...@gmail.com 

[PATCH v3] arm/xilinx_zynq: Disable the MMU and the data and instruction cache on boot.

2016-08-30 Thread Chris Johns
The u-boot loader can enable the MMU plus the data and instruction caches.
Disable them and if the data cache is enabled clear it before turn the caches 
off.

Closes #2774.
---
 c/src/lib/libbsp/arm/shared/include/arm-cp15-start.h   | 4 
 c/src/lib/libbsp/arm/xilinx-zynq/startup/bspstartmmu.c | 2 +-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/c/src/lib/libbsp/arm/shared/include/arm-cp15-start.h 
b/c/src/lib/libbsp/arm/shared/include/arm-cp15-start.h
index 01fdbb3..7734ddc 100644
--- a/c/src/lib/libbsp/arm/shared/include/arm-cp15-start.h
+++ b/c/src/lib/libbsp/arm/shared/include/arm-cp15-start.h
@@ -166,6 +166,10 @@ arm_cp15_start_setup_mmu_and_cache(uint32_t ctrl_clear, 
uint32_t ctrl_set)
 {
   uint32_t ctrl = arm_cp15_get_control();
 
+  if ((ctrl & ARM_CP15_CTRL_C) != 0) {
+arm_cp15_data_cache_clean_all_levels();
+  }
+
   ctrl &= ~ctrl_clear;
   ctrl |= ctrl_set;
 
diff --git a/c/src/lib/libbsp/arm/xilinx-zynq/startup/bspstartmmu.c 
b/c/src/lib/libbsp/arm/xilinx-zynq/startup/bspstartmmu.c
index c7a1089..0918588 100644
--- a/c/src/lib/libbsp/arm/xilinx-zynq/startup/bspstartmmu.c
+++ b/c/src/lib/libbsp/arm/xilinx-zynq/startup/bspstartmmu.c
@@ -41,7 +41,7 @@ BSP_START_TEXT_SECTION void zynq_setup_mmu_and_cache(void) 
__attribute__ ((weak)
 BSP_START_TEXT_SECTION void zynq_setup_mmu_and_cache(void)
 {
   uint32_t ctrl = arm_cp15_start_setup_mmu_and_cache(
-ARM_CP15_CTRL_A,
+ARM_CP15_CTRL_A | ARM_CP15_CTRL_C | ARM_CP15_CTRL_I | ARM_CP15_CTRL_M,
 ARM_CP15_CTRL_AFE | ARM_CP15_CTRL_Z
   );
 
-- 
2.4.6

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel


[PATCH] arm/xilinx_zynq: Start the second core when an SMP build.

2016-08-30 Thread Chris Johns
---
 c/src/lib/libbsp/arm/xilinx-zynq/startup/bspsmp.c  | 15 +++
 c/src/lib/libbsp/arm/xilinx-zynq/startup/bspstartmmu.c |  7 +++
 2 files changed, 22 insertions(+)

diff --git a/c/src/lib/libbsp/arm/xilinx-zynq/startup/bspsmp.c 
b/c/src/lib/libbsp/arm/xilinx-zynq/startup/bspsmp.c
index 3940352..310014d 100644
--- a/c/src/lib/libbsp/arm/xilinx-zynq/startup/bspsmp.c
+++ b/c/src/lib/libbsp/arm/xilinx-zynq/startup/bspsmp.c
@@ -14,9 +14,24 @@
 
 #include 
 
+extern void _start(void);
+
 bool _CPU_SMP_Start_processor(uint32_t cpu_index)
 {
   /*
+   * Enable the second CPU.
+   */
+  if (cpu_index != 0) {
+volatile uint32_t* const kick_address = (uint32_t*) 0xfff0UL;
+_ARM_Data_synchronization_barrier();
+_ARM_Instruction_synchronization_barrier();
+*kick_address = (uint32_t) _start;
+_ARM_Data_synchronization_barrier();
+_ARM_Instruction_synchronization_barrier();
+_ARM_Send_event();
+  }
+
+  /*
* Wait for secondary processor to complete its basic initialization so that
* we can enable the unified L2 cache.
*/
diff --git a/c/src/lib/libbsp/arm/xilinx-zynq/startup/bspstartmmu.c 
b/c/src/lib/libbsp/arm/xilinx-zynq/startup/bspstartmmu.c
index c7a1089..e0a7743 100644
--- a/c/src/lib/libbsp/arm/xilinx-zynq/startup/bspstartmmu.c
+++ b/c/src/lib/libbsp/arm/xilinx-zynq/startup/bspstartmmu.c
@@ -22,6 +22,13 @@
 BSP_START_DATA_SECTION static const arm_cp15_start_section_config
 zynq_mmu_config_table[] = {
   ARMV7_CP15_START_DEFAULT_SECTIONS,
+#if defined(RTEMS_SMP)
+  {
+.begin = 0xU,
+.end = 0xU,
+.flags = ARMV7_MMU_DEVICE
+  },
+#endif
   {
 .begin = 0xe000U,
 .end = 0xe020U,
-- 
2.3.0

___
devel mailing list
devel@rtems.org
http://lists.rtems.org/mailman/listinfo/devel