summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/shared
diff options
context:
space:
mode:
authorChris Johns <chrisj@rtems.org>2016-04-08 18:39:38 +1000
committerChris Johns <chrisj@rtems.org>2016-05-11 11:45:01 +1000
commit014292a164b8bb5286b6c7dae7c37a469ef6f0cc (patch)
treec7343485ef520fc71f36e5cf8271e08a2c1de789 /c/src/lib/libbsp/shared
parentbsp/qoriq: Add portal clear functions (diff)
downloadrtems-014292a164b8bb5286b6c7dae7c37a469ef6f0cc.tar.bz2
i386/pc386: Add support for the gdb stub to use available console drivers.
Move the gdb stub from the i386 UART code to use the libchip drivers. Use any ports discovered during the probes. Add gdb control to the boot command line. Change the device naming to the full device path, not a partial path. For example /dev/com1.
Diffstat (limited to 'c/src/lib/libbsp/shared')
-rw-r--r--c/src/lib/libbsp/shared/console.c43
-rw-r--r--c/src/lib/libbsp/shared/console_private.h13
2 files changed, 53 insertions, 3 deletions
diff --git a/c/src/lib/libbsp/shared/console.c b/c/src/lib/libbsp/shared/console.c
index d2261723f8..b4af1b389a 100644
--- a/c/src/lib/libbsp/shared/console.c
+++ b/c/src/lib/libbsp/shared/console.c
@@ -34,6 +34,45 @@ rtems_device_minor_number Console_Port_Minor = 0;
static bool console_initialized = false;
/*
+ * console_find_console_entry
+ *
+ * This method is used to search the console entries for a
+ * specific device entry.
+ */
+console_tbl* console_find_console_entry(
+ const char *match,
+ size_t length,
+ rtems_device_minor_number *match_minor
+)
+{
+ rtems_device_minor_number minor;
+
+ /*
+ * The the match name is NULL get the minor number entry.
+ */
+ if (match == NULL) {
+ if (*match_minor < Console_Port_Count)
+ return Console_Port_Tbl[*match_minor];
+ return NULL;
+ }
+
+ for (minor=0; minor < Console_Port_Count ; minor++) {
+ console_tbl *cptr = Console_Port_Tbl[minor];
+
+ /*
+ * Console table entries include /dev/ prefix, device names passed
+ * in on command line do not.
+ */
+ if ( !strncmp( cptr->sDeviceName, match, length ) ) {
+ *match_minor = minor;
+ return cptr;
+ }
+ }
+
+ return NULL;
+}
+
+/*
* console_initialize_data
*
* This method is used to initialize the table of pointers to the
@@ -278,9 +317,7 @@ rtems_device_driver console_initialize(
* must still initialize pointers for Console_Port_Tbl and
* Console_Port_Data.
*/
- if ( !Console_Port_Tbl ) {
- console_initialize_data();
- }
+ console_initialize_data();
/*
* console_initialize has been invoked so it is now too late to
diff --git a/c/src/lib/libbsp/shared/console_private.h b/c/src/lib/libbsp/shared/console_private.h
index 42a8ee9206..3855e83100 100644
--- a/c/src/lib/libbsp/shared/console_private.h
+++ b/c/src/lib/libbsp/shared/console_private.h
@@ -41,6 +41,19 @@ int vt_ioctl(
);
/**
+ * @brief console_find_console_entry
+ *
+ * This method is used to search the console entries for a
+ * specific device entry and return it. If match is NULL the
+ * minor number provided is matched.
+ */
+console_tbl* console_find_console_entry(
+ const char *match,
+ size_t length,
+ rtems_device_minor_number *match_minor
+);
+
+/**
* @brief console_initialize_data
*
* This must be called before dynamic registration of devices can occur.