[U-Boot] [RFC PATCH v2 0/5] Add environment call-back capability

Joe Hershberger joe.hershberger at ni.com
Fri Sep 28 00:47:35 CEST 2012


When a variable with a registered callback is inserted, deleted, or
overwritten the callback is called and gives the system an opportunity
to do something in response to the change.  It also has the opportunuty
to reject the change by returning non-zero.

Before I go much further, I want to get a little feedback if this is a
good implementation.  It certainly cleans up cmd_nvedit.c significantly!

Changes in v2:
- Added much-needed documentation
- Factored out prevch and nextch in env_attr_lookup()

Joe Hershberger (5):
  env: Add support for callbacks to environment vars
  env: Add a loadaddr env handler
  env: Add a bootfile env handler
  env: Add a baudrate env handler
  env: Add a console env handler

 README                  |  28 ++++++++
 arch/arm/cpu/u-boot.lds |   7 ++
 common/Makefile         |   4 +-
 common/cmd_load.c       |  24 ++++++-
 common/cmd_nvedit.c     |  87 ----------------------
 common/console.c        |  46 ++++++++++++
 common/env_attr.c       | 187 ++++++++++++++++++++++++++++++++++++++++++++++++
 common/env_callback.c   | 130 +++++++++++++++++++++++++++++++++
 common/serial.c         |  58 +++++++++++++++
 include/env_attr.h      |  55 ++++++++++++++
 include/env_callback.h  |  74 +++++++++++++++++++
 include/environment.h   |   2 +
 include/search.h        |   5 ++
 lib/hashtable.c         |  65 ++++++++++++++++-
 net/net.c               |  16 +++++
 15 files changed, 697 insertions(+), 91 deletions(-)
 create mode 100644 common/env_attr.c
 create mode 100644 common/env_callback.c
 create mode 100644 include/env_attr.h
 create mode 100644 include/env_callback.h

-- 
1.7.11.5



More information about the U-Boot mailing list