From: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
To: barebox@lists.infradead.org
Subject: [PATCH 1/5] shutdown: add board call back
Date: Thu, 19 Sep 2013 15:20:22 +0200 [thread overview]
Message-ID: <1379596826-5743-1-git-send-email-plagnioj@jcrosoft.com> (raw)
In-Reply-To: <20130919131929.GA1137@ns203013.ovh.net>
so if we need to do something switch in the board we can fill this function
pointer (as example on Animeo IP shutdown some rs232 & rs485)
Signed-off-by: Jean-Christophe PLAGNIOL-VILLARD <plagnioj@jcrosoft.com>
---
common/startup.c | 4 ++++
include/common.h | 1 +
2 files changed, 5 insertions(+)
diff --git a/common/startup.c b/common/startup.c
index 9b33a92..ece852c 100644
--- a/common/startup.c
+++ b/common/startup.c
@@ -159,6 +159,8 @@ void __noreturn hang (void)
for (;;);
}
+void (*board_shutdown)(void);
+
/* Everything needed to cleanly shutdown barebox.
* Should be called before starting an OS to get
* the devices into a clean state
@@ -169,4 +171,6 @@ void shutdown_barebox(void)
#ifdef ARCH_SHUTDOWN
arch_shutdown();
#endif
+ if (board_shutdown)
+ board_shutdown();
}
diff --git a/include/common.h b/include/common.h
index 066827f..0f0ba08 100644
--- a/include/common.h
+++ b/include/common.h
@@ -152,6 +152,7 @@ extern int (*barebox_main)(void);
void __noreturn start_barebox(void);
void shutdown_barebox(void);
+extern void (*board_shutdown)(void);
/*
* architectures which have special calling conventions for
--
1.8.4.rc1
_______________________________________________
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox
next prev parent reply other threads:[~2013-09-19 13:19 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-19 13:19 [PATCH 0/5] introduce basic rs485 support Jean-Christophe PLAGNIOL-VILLARD
2013-09-19 13:20 ` Jean-Christophe PLAGNIOL-VILLARD [this message]
2013-09-19 13:20 ` [PATCH 2/5] console: introduce console_get_by_dev Jean-Christophe PLAGNIOL-VILLARD
2013-09-19 13:20 ` [PATCH 3/5] console: introduce new callback set_mode Jean-Christophe PLAGNIOL-VILLARD
2013-09-19 13:20 ` [PATCH 4/5] atmel_serial: add rs485 support Jean-Christophe PLAGNIOL-VILLARD
2013-09-19 13:20 ` [PATCH 5/5] Animeo IP: add rs485 crossing detection support Jean-Christophe PLAGNIOL-VILLARD
2013-09-24 7:22 ` [PATCH 0/5] introduce basic rs485 support Sascha Hauer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1379596826-5743-1-git-send-email-plagnioj@jcrosoft.com \
--to=plagnioj@jcrosoft.com \
--cc=barebox@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox