Index: uspace/app/sbi/src/intmap.c
===================================================================
--- uspace/app/sbi/src/intmap.c	(revision 1ebc1a62b0e759c001488fc0e221be6347082167)
+++ uspace/app/sbi/src/intmap.c	(revision 0eff68e2235e2f4737160b4f06cd3e6c1b217a5e)
@@ -50,4 +50,15 @@
 }
 
+/** Deinitialize map.
+ *
+ * The map must be already empty.
+ *
+ * @param intmap	Map to initialize.
+ */
+void intmap_fini(intmap_t *intmap)
+{
+	list_fini(&intmap->elem);
+}
+
 /** Set value corresponding to a key.
  *
@@ -56,7 +67,7 @@
  * is removed from the map.
  *
- * @param intmap	Map.
- * @param key		Key (integer).
- * @param value		Value (must be a pointer) or @c NULL.
+ * @param intmap	Map
+ * @param key		Key (integer)
+ * @param value		Value (must be a pointer) or @c NULL
  */
 void intmap_set(intmap_t *intmap, int key, void *value)
@@ -75,6 +86,5 @@
 				/* Remove map element. */
 				list_remove(&intmap->elem, node);
-				node->data = NULL;
-				free(node);
+				free(elem);
 			}
 			return;
@@ -98,6 +108,6 @@
 /** Get value corresponding to a key.
  *
- * @param intmap	Map.
- * @param key		Key for which to retrieve mapping.
+ * @param intmap	Map
+ * @param key		Key for which to retrieve mapping
  *
  * @return		Value correspoding to @a key or @c NULL if no mapping
@@ -121,2 +131,45 @@
 	return NULL;
 }
+
+/** Get first element in the map.
+ *
+ * For iterating over the map, this returns the first element (in no
+ * particular order).
+ *
+ * @param intmap	Map
+ * @return		Map element or NULL if the map is empty
+ */
+map_elem_t *intmap_first(intmap_t *intmap)
+{
+	list_node_t *node;
+
+	node = list_first(&intmap->elem);
+	if (node == NULL)
+		return NULL;
+
+	return list_node_data(node, map_elem_t *);
+}
+
+/** Get element key.
+ *
+ * Giver a map element, return the key.
+ *
+ * @param elem		Map element
+ * @return		Key
+ */
+int intmap_elem_get_key(map_elem_t *elem)
+{
+	return elem->key;
+}
+
+/** Get element value.
+ *
+ * Giver a map element, return the value.
+ *
+ * @param elem		Map element
+ * @return		Value
+ */
+void *intmap_elem_get_value(map_elem_t *elem)
+{
+	return elem->value;
+}
