aboutsummaryrefslogtreecommitdiffstats
path: root/libc/include
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2013-06-25 00:07:53 +0000
committerGerrit Code Review <noreply-gerritcodereview@google.com>2013-06-25 00:07:53 +0000
commit1642edb5208fe02ef64d5734fffaf7c4a724fd2f (patch)
tree438d92641ff419d9836fbbfe992e9f6dcbcb46aa /libc/include
parent0ea1d5c0ae94ee581c72451b20813c028f51090c (diff)
parent836dbf65e4370df38cddc170229a7b0bdf882c8c (diff)
downloadandroid_bionic-1642edb5208fe02ef64d5734fffaf7c4a724fd2f.tar.gz
android_bionic-1642edb5208fe02ef64d5734fffaf7c4a724fd2f.tar.bz2
android_bionic-1642edb5208fe02ef64d5734fffaf7c4a724fd2f.zip
Merge changes Ib074192d,I6df3afed,I69070455,Icbe31908,Id3fa4526,I038d451f
* changes: bionic: store property names as variable-length strings bionic: prevent root processes from calling __system_property_add bionic: revert to a single (larger) property area bionic: reimplement property area as hybrid trie/binary tree bionic: add missing memory barriers to system properties bionic: make property area expandable
Diffstat (limited to 'libc/include')
-rw-r--r--libc/include/sys/_system_properties.h25
1 files changed, 9 insertions, 16 deletions
diff --git a/libc/include/sys/_system_properties.h b/libc/include/sys/_system_properties.h
index c5bc2235b..92e35e124 100644
--- a/libc/include/sys/_system_properties.h
+++ b/libc/include/sys/_system_properties.h
@@ -37,20 +37,12 @@
typedef struct prop_msg prop_msg;
#define PROP_AREA_MAGIC 0x504f5250
-#define PROP_AREA_VERSION 0x45434f76
+#define PROP_AREA_VERSION 0xfc6ed0ab
#define PROP_SERVICE_NAME "property_service"
#define PROP_FILENAME "/dev/__properties__"
-/* (8 header words + 247 toc words) = 1020 bytes */
-/* 1024 bytes header and toc + 247 prop_infos @ 128 bytes = 32640 bytes */
-
-#define PA_COUNT_MAX 247
-#define PA_INFO_START 1024
-#define PA_SIZE 32768
-
-#define TOC_NAME_LEN(toc) ((toc) >> 24)
-#define TOC_TO_INFO(area, toc) ((prop_info*) (((char*) area) + ((toc) & 0xFFFFFF)))
+#define PA_SIZE (128 * 1024)
#define SERIAL_VALUE_LEN(serial) ((serial) >> 24)
#define SERIAL_DIRTY(serial) ((serial) & 1)
@@ -83,11 +75,6 @@ struct prop_msg
** 1. pi->serial = pi->serial | 1
** 2. memcpy(pi->value, local_value, value_len)
** 3. pi->serial = (value_len << 24) | ((pi->serial + 1) & 0xffffff)
-**
-** Improvements:
-** - maintain the toc sorted by pi->name to allow lookup
-** by binary search
-**
*/
#define PROP_PATH_RAMDISK_DEFAULT "/default.prop"
@@ -97,11 +84,17 @@ struct prop_msg
#define PROP_PATH_FACTORY "/factory/factory.prop"
/*
+** Map the property area from the specified filename. This
+** method is for testing only.
+*/
+int __system_property_set_filename(const char *filename);
+
+/*
** Initialize the area to be used to store properties. Can
** only be done by a single process that has write access to
** the property area.
*/
-void __system_property_area_init(void *data);
+int __system_property_area_init();
/* Add a new system property. Can only be done by a single
** process that has write access to the property area, and