Index: contrib/arch/HelenOS.adl
===================================================================
--- contrib/arch/HelenOS.adl	(revision ec8bab59255734063dbf86e43ca51eeeb9ff58e8)
+++ contrib/arch/HelenOS.adl	(revision 1993f9a68ff3c23290d79db8b57db81b201848c4)
@@ -12,11 +12,17 @@
 	inst klog klog;
 	
+	/* VFS */
+	inst vfs vfs;
+	
 	[/uspace/lib/libc/bind%ns]
 	
-	[/usrpace/lib/libc/bind%rd]
+	[/uspace/lib/libc/bind%rd]
 	bind rd:ns to ns:ns;
 	bind rd:dm_driver to devmap:dm_driver;
 	
-	[/usrpace/lib/libc/bind%klog]
+	[/uspace/lib/libc/bind%klog]
 	bind klog:ns to ns:ns;
+	
+	[/uspace/lib/libc/bind%vfs]
+	bind vfs:ns to ns:ns;
 };
Index: contrib/arch/hadlbppp.py
===================================================================
--- contrib/arch/hadlbppp.py	(revision ec8bab59255734063dbf86e43ca51eeeb9ff58e8)
+++ contrib/arch/hadlbppp.py	(revision 1993f9a68ff3c23290d79db8b57db81b201848c4)
@@ -48,12 +48,11 @@
 	if (trim):
 		token = token.strip(" \t")
-		if (token != ""):
-			tokens.append(token)
-	else:
+	
+	if (token != ""):
 		tokens.append(token)
 	
 	return tokens
 
-def split_tokens(string, delimiters, trim = False):
+def split_tokens(string, delimiters, trim = False, separate = False):
 	"Split string to tokens by delimiters, keep the delimiters"
 	
@@ -66,7 +65,13 @@
 			if (len(delim) > 0):
 				
-				if ((string[i:(i + len(delim))] == delim) and (i > 0)):
-					tokens = cond_append(tokens, string[last:i], trim)
-					last = i
+				if (string[i:(i + len(delim))] == delim):
+					if (separate):
+						tokens = cond_append(tokens, string[last:i], trim)
+						tokens = cond_append(tokens, delim, trim)
+						last = i + len(delim)
+					elif (i > 0):
+						tokens = cond_append(tokens, string[last:i], trim)
+						last = i
+					
 					i += len(delim) - 1
 					break
@@ -78,16 +83,68 @@
 	return tokens
 
-def parse(fname, outf):
-	"Parse particular protocol"
-	
-	inf = file(fname, "r")
-	outf.write("### %s\n\n" % fname)
-	
-	tokens = split_tokens(inf.read(), ["\n", " ", "\t", "(", ")", "{", "}", "[", "/*", "*/", "#", "*", ";", "+", "||", "|", "!", "?"], True)
-	
+def preproc_bp(outname, tokens):
+	"Preprocess tentative statements in Behavior Protocol"
+	
+	result = []
+	i = 0
+	
+	while (i < len(tokens)):
+		if (tokens[i] == "tentative"):
+			if ((i + 1 < len(tokens)) and (tokens[i + 1] == "{")):
+				i += 2
+				start = i
+				level = 1
+				
+				while ((i < len(tokens)) and (level > 0)):
+					if (tokens[i] == "{"):
+						level += 1
+					elif (tokens[i] == "}"):
+						level -= 1
+					
+					i += 1
+				
+				if (level == 0):
+					result.append("(")
+					result.extend(preproc_bp(outname, tokens[start:(i - 1)]))
+					result.append(")")
+					result.append("+")
+					result.append("NULL")
+				else:
+					print "%s: Syntax error in tentative statement" % outname
+			else:
+				print "%s: Unexpected tentative statement" % outname
+		else:
+			result.append(tokens[i])
+		
+		i += 1
+	
+	return result
+
+def parse_bp(base, root, inname, nested, outname, outf, indent):
+	"Parse Behavior Protocol"
+	
+	if (nested):
+		if (inname[0:1] == "/"):
+			path = os.path.join(base, ".%s" % inname)
+			nested_root = os.path.dirname(path)
+		else:
+			path = os.path.join(root, inname)
+			nested_root = root
+		
+		if (not os.path.isfile(path)):
+			print "%s: Unable to include file %s" % (outname, path)
+			return True
+		
+		inf = file(path, "r")
+	else:
+		inf = file(inname, "r")
+		nested_root = root
+	
+	tokens = preproc_bp(outname, split_tokens(inf.read(), ["\n", " ", "\t", "(", ")", "{", "}", "[", "]", "/*", "*/", "#", "*", ";", "+", "||", "|", "!", "?"], True, True))
+	
+	inc = False
 	empty = True
 	comment = False
 	lcomment = False
-	indent = 0
 	
 	for token in tokens:
@@ -116,30 +173,143 @@
 			empty = False
 		
+		if (inc):
+			outf.write("\n%s(" % tabs(indent))
+			
+			inc_empty = parse_bp(base, nested_root, token, True, outname, outf, indent + 1)
+			if (inc_empty):
+				outf.write("\n%sNULL" % tabs(indent + 1))
+			
+			outf.write("\n%s)" % tabs(indent))
+			inc = False
+			continue
+		
 		if ((token == ";") or (token == "+") or (token == "||") or (token == "|")):
-			outf.write(" %s\n" % token)
+			outf.write(" %s" % token)
+		elif (token == "["):
+			inc = True
+		elif (token == "]"):
+			inc = False
 		elif (token == "("):
-			outf.write("%s%s\n" % (tabs(indent), token))
+			outf.write("\n%s%s" % (tabs(indent), token))
 			indent += 1
 		elif (token == ")"):
+			if (indent == 0):
+				print "%s: Too many closing parentheses" % outname
+			
 			indent -= 1
 			outf.write("\n%s%s" % (tabs(indent), token))
 		elif (token == "{"):
-			outf.write(" %s\n" % token)
+			outf.write(" %s" % token)
 			indent += 1
 		elif (token == "}"):
+			if (indent == 0):
+				print "%s: Too many closing parentheses" % outname
+			
 			indent -= 1
 			outf.write("\n%s%s" % (tabs(indent), token))
 		elif (token == "*"):
 			outf.write("%s" % token)
-		else:
-			outf.write("%s%s" % (tabs(indent), token))
-	
+		elif ((token == "!") or (token == "?") or (token == "NULL")):
+			outf.write("\n%s%s" % (tabs(indent), token))
+		else:
+			outf.write("%s" % token)
+	
+	inf.close()
+	
+	return empty
+
+def parse_adl(base, root, inname, nested, outname, outf, indent):
+	"Parse Architecture Description Language"
+	
+	if (nested):
+		(infname, inarg) = inname.split("%")
+		
+		if (infname[0:1] == "/"):
+			path = os.path.join(base, ".%s" % infname)
+			nested_root = os.path.dirname(path)
+		else:
+			path = os.path.join(root, infname)
+			nested_root = root
+		
+		if (not os.path.isfile(path)):
+			print "%s: Unable to include file %s" % (outname, path)
+			return True
+		
+		inf = file(path, "r")
+	else:
+		inarg = "%%"
+		inf = file(inname, "r")
+		nested_root = root
+	
+	tokens = split_tokens(inf.read(), ["\n", " ", "\t", "%%", "[", "]"], False, True)
+	
+	inc = False
+	empty = True
+	newline = True
+	locindent = 0
+	
+	for token in tokens:
+		if (empty):
+			empty = False
+		
+		if (inc):
+			if (token.find("%") != -1):
+				parse_adl(base, nested_root, token, True, outname, outf, locindent)
+			else:
+				parse_bp(base, nested_root, token, True, outname, outf, locindent)
+			
+			inc = False
+			continue
+		
+		if (token == "\n"):
+			newline = True
+			locindent = 0
+			outf.write("\n%s" % tabs(indent))
+		elif (token == "\t"):
+			if (newline):
+				locindent += 1
+			outf.write("%s" % token)
+		elif (token == "%%"):
+			newline = False
+			outf.write("%s" % inarg)
+		elif (token == "["):
+			newline = False
+			inc = True
+		elif (token == "]"):
+			newline = False
+			inc = False
+		else:
+			newline = False;
+			outf.write("%s" % token)
+	
+	inf.close()
+	
+	return empty
+
+def open_bp(base, root, inname, outname):
+	"Open Behavior Protocol file"
+	
+	outf = file(outname, "w")
+	
+	outf.write("### %s\n" % inname)
+	
+	empty = parse_bp(base, root, inname, False, outname, outf, 0)
 	if (empty):
 		outf.write("NULL")
 	
-	outf.write("\n\n\n")
-	inf.close()
-
-def recursion(root, output, level):
+	outf.close()
+
+def open_adl(base, root, inname, outname):
+	"Open Architecture Description file"
+	
+	outf = file(outname, "w")
+	
+	empty = parse_adl(base, root, inname, False, outname, outf, 0)
+	if (empty):
+		outf.write("/* Empty */")
+	
+	outf.close()
+
+def recursion(base, root, output, level):
 	"Recursive directory walk"
 	
@@ -147,11 +317,24 @@
 		canon = os.path.join(root, name)
 		
-		if ((os.path.isfile(canon)) and (level > 0)):
+		if (os.path.isfile(canon)):
 			fcomp = split_tokens(canon, ["."])
+			cname = canon.split("/")
+			
+			filtered = False
+			while (not filtered):
+				try:
+					cname.remove(".")
+				except (ValueError):
+					filtered = True
+			
+			output_path = os.path.join(output, ".".join(cname))
+			
 			if (fcomp[-1] == ".bp"):
-				parse(canon, outf)
+				open_bp(base, root, canon, output_path)
+			elif (fcomp[-1] == ".adl"):
+				open_adl(base, root, canon, output_path)
 		
 		if (os.path.isdir(canon)):
-			recursion(canon, outf, level + 1)
+			recursion(base, canon, output, level + 1)
 
 def main():
@@ -162,9 +345,9 @@
 	path = os.path.abspath(sys.argv[1])
 	if (not os.path.isdir(path)):
-		print "<OUTPUT> is not a directory"
+		print "Error: <OUTPUT> is not a directory"
 		return
 	
-	recursion(".", path, 0)
-	
+	recursion(".", ".", path, 0)
+
 if __name__ == '__main__':
 	main()
Index: contrib/arch/uspace/lib/libc/fnc.devmap_device_get_count
===================================================================
--- contrib/arch/uspace/lib/libc/fnc.devmap_device_get_count	(revision ec8bab59255734063dbf86e43ca51eeeb9ff58e8)
+++ contrib/arch/uspace/lib/libc/fnc.devmap_device_get_count	(revision 1993f9a68ff3c23290d79db8b57db81b201848c4)
@@ -1,2 +1,4 @@
 [fnc.devmap_get_phone] ;
-!dm_client.device_get_count
+tentative {
+	!dm_client.device_get_count
+}
Index: contrib/arch/uspace/lib/libc/fnc.devmap_device_get_devices
===================================================================
--- contrib/arch/uspace/lib/libc/fnc.devmap_device_get_devices	(revision ec8bab59255734063dbf86e43ca51eeeb9ff58e8)
+++ contrib/arch/uspace/lib/libc/fnc.devmap_device_get_devices	(revision 1993f9a68ff3c23290d79db8b57db81b201848c4)
@@ -1,4 +1,6 @@
 [fnc.devmap_get_phone] ;
-!dm_client.device_get_devices {
-	!dm_client.ipc_m_data_read /* buffer */
+tentative {
+	!dm_client.device_get_devices {
+		!dm_client.ipc_m_data_read /* buffer */
+	}
 }
Index: contrib/arch/uspace/lib/libc/fnc.devmap_device_get_handle
===================================================================
--- contrib/arch/uspace/lib/libc/fnc.devmap_device_get_handle	(revision ec8bab59255734063dbf86e43ca51eeeb9ff58e8)
+++ contrib/arch/uspace/lib/libc/fnc.devmap_device_get_handle	(revision 1993f9a68ff3c23290d79db8b57db81b201848c4)
@@ -1,4 +1,6 @@
 [fnc.devmap_get_phone] ;
-!dm_client.device_get_handle {
-	!dm_client.ipc_m_data_write /* name */
+tentative {
+	!dm_client.device_get_handle {
+		!dm_client.ipc_m_data_write /* name */
+	}
 }
Index: contrib/arch/uspace/lib/libc/fnc.devmap_device_register
===================================================================
--- contrib/arch/uspace/lib/libc/fnc.devmap_device_register	(revision 1993f9a68ff3c23290d79db8b57db81b201848c4)
+++ contrib/arch/uspace/lib/libc/fnc.devmap_device_register	(revision 1993f9a68ff3c23290d79db8b57db81b201848c4)
@@ -0,0 +1,6 @@
+[fnc.devmap_get_phone] ;
+tentative {
+	!devmap.device_register {
+		!devmap.ipc_m_data_write /* name */
+	} ;
+}
Index: contrib/arch/uspace/lib/libc/fnc.devmap_driver_register
===================================================================
--- contrib/arch/uspace/lib/libc/fnc.devmap_driver_register	(revision 1993f9a68ff3c23290d79db8b57db81b201848c4)
+++ contrib/arch/uspace/lib/libc/fnc.devmap_driver_register	(revision 1993f9a68ff3c23290d79db8b57db81b201848c4)
@@ -0,0 +1,9 @@
+[fnc.devmap_get_phone] ;
+tentative {
+	!devmap.driver_register {
+		!devmap.ipc_m_data_write /* name */
+	} ;
+	tentative {
+		!devmap.ipc_m_connect_to_me
+	}
+}
Index: contrib/arch/uspace/lib/libfs/fnc.fs_register
===================================================================
--- contrib/arch/uspace/lib/libfs/fnc.fs_register	(revision 1993f9a68ff3c23290d79db8b57db81b201848c4)
+++ contrib/arch/uspace/lib/libfs/fnc.fs_register	(revision 1993f9a68ff3c23290d79db8b57db81b201848c4)
@@ -0,0 +1,5 @@
+!vfs.register {
+	!vfs.ipc_m_data_write /* vfs_into_t */
+} ;
+!vfs.ipc_m_connect_to_me ;
+!vfs.ipc_m_share_in
Index: contrib/arch/uspace/lib/libfs/fnc.libfs_lookup
===================================================================
--- contrib/arch/uspace/lib/libfs/fnc.libfs_lookup	(revision 1993f9a68ff3c23290d79db8b57db81b201848c4)
+++ contrib/arch/uspace/lib/libfs/fnc.libfs_lookup	(revision 1993f9a68ff3c23290d79db8b57db81b201848c4)
@@ -0,0 +1,1 @@
+!fs.lookup*
Index: contrib/arch/uspace/lib/libfs/fnc.libfs_mount
===================================================================
--- contrib/arch/uspace/lib/libfs/fnc.libfs_mount	(revision 1993f9a68ff3c23290d79db8b57db81b201848c4)
+++ contrib/arch/uspace/lib/libfs/fnc.libfs_mount	(revision 1993f9a68ff3c23290d79db8b57db81b201848c4)
@@ -0,0 +1,6 @@
+?fs.ipc_m_connection_clone ;
+?fs.ipc_m_data_write /* mount options */ {
+	!fs.ipc_m_connect_to_me ;
+	!fs.mounted ;
+	!fs.ipc_m_data_write /* forward */
+}
Index: contrib/arch/uspace/lib/libfs/fnc.libfs_stat
===================================================================
--- contrib/arch/uspace/lib/libfs/fnc.libfs_stat	(revision 1993f9a68ff3c23290d79db8b57db81b201848c4)
+++ contrib/arch/uspace/lib/libfs/fnc.libfs_stat	(revision 1993f9a68ff3c23290d79db8b57db81b201848c4)
@@ -0,0 +1,1 @@
+?fs.ipc_m_data_read
Index: ntrib/arch/uspace/lib/libfs/fs_register
===================================================================
--- contrib/arch/uspace/lib/libfs/fs_register	(revision ec8bab59255734063dbf86e43ca51eeeb9ff58e8)
+++ 	(revision )
@@ -1,4 +1,0 @@
-!vfs.VFS_IN_REGISTER ;
-!vfs.IPC_M_DATA_WRITE /* vfs_into_t */ ;
-!vfs.IPC_M_CONNECT_TO_ME ;
-!vfs.IPC_M_SHARE_IN
Index: ntrib/arch/uspace/lib/libfs/libfs_lookup
===================================================================
--- contrib/arch/uspace/lib/libfs/libfs_lookup	(revision ec8bab59255734063dbf86e43ca51eeeb9ff58e8)
+++ 	(revision )
@@ -1,1 +1,0 @@
-!fs.VFS_OUT_LOOKUP*
Index: ntrib/arch/uspace/lib/libfs/libfs_mount
===================================================================
--- contrib/arch/uspace/lib/libfs/libfs_mount	(revision ec8bab59255734063dbf86e43ca51eeeb9ff58e8)
+++ 	(revision )
@@ -1,6 +1,0 @@
-?fs.IPC_M_CONNECTION_CLONE ;
-?fs.IPC_M_DATA_WRITE /* mount options */ {
-	!fs.IPC_M_CONNECT_ME ;
-	!fs.VFS_OUT_MOUNTED ;
-	!fs.IPC_M_DATA_WRITE /* forwarded */
-}
Index: ntrib/arch/uspace/lib/libfs/libfs_stat
===================================================================
--- contrib/arch/uspace/lib/libfs/libfs_stat	(revision ec8bab59255734063dbf86e43ca51eeeb9ff58e8)
+++ 	(revision )
@@ -1,1 +1,0 @@
-?fs.IPC_M_DATA_READ
Index: contrib/arch/uspace/srv/bd/rd/rd.adl
===================================================================
--- contrib/arch/uspace/srv/bd/rd/rd.adl	(revision ec8bab59255734063dbf86e43ca51eeeb9ff58e8)
+++ contrib/arch/uspace/srv/bd/rd/rd.adl	(revision 1993f9a68ff3c23290d79db8b57db81b201848c4)
@@ -3,7 +3,7 @@
 		block_device bd;
 	requires:
+		[/uspace/lib/libc/requires%]
 		naming_service ns;
 		device_mapper_driver dm_driver;
-		[/uspace/lib/libc/requires]
 	protocol:
 		[/uspace/lib/libc/protocol] +
Index: contrib/arch/uspace/srv/bd/rd/rd.bp
===================================================================
--- contrib/arch/uspace/srv/bd/rd/rd.bp	(revision ec8bab59255734063dbf86e43ca51eeeb9ff58e8)
+++ contrib/arch/uspace/srv/bd/rd/rd.bp	(revision 1993f9a68ff3c23290d79db8b57db81b201848c4)
@@ -1,2 +1,2 @@
-[/lib/libc/fnc.devmap_driver_register] ;
-[/lib/libc/fnc.devmap_device_register]
+[/uspace/lib/libc/fnc.devmap_driver_register] ;
+[/uspace/lib/libc/fnc.devmap_device_register]
Index: ntrib/arch/uspace/srv/console/cell_mark_changed
===================================================================
--- contrib/arch/uspace/srv/console/cell_mark_changed	(revision ec8bab59255734063dbf86e43ca51eeeb9ff58e8)
+++ 	(revision )
@@ -1,4 +1,0 @@
-(
-	[fb_pending_flush] +
-	NULL
-)
Index: ntrib/arch/uspace/srv/console/clear
===================================================================
--- contrib/arch/uspace/srv/console/clear	(revision ec8bab59255734063dbf86e43ca51eeeb9ff58e8)
+++ 	(revision )
@@ -1,1 +1,0 @@
-!fb.FB_CLEAR
Index: ntrib/arch/uspace/srv/console/cons_read
===================================================================
--- contrib/arch/uspace/srv/console/cons_read	(revision ec8bab59255734063dbf86e43ca51eeeb9ff58e8)
+++ 	(revision )
@@ -1,1 +1,0 @@
-?console.IPC_M_DATA_READ
Index: ntrib/arch/uspace/srv/console/cons_write
===================================================================
--- contrib/arch/uspace/srv/console/cons_write	(revision ec8bab59255734063dbf86e43ca51eeeb9ff58e8)
+++ 	(revision )
@@ -1,3 +1,0 @@
-?console.IPC_M_DATA_WRITE ;
-[write_char]* ;
-[gcons_notify_char]
Index: contrib/arch/uspace/srv/console/console.bp
===================================================================
--- contrib/arch/uspace/srv/console/console.bp	(revision ec8bab59255734063dbf86e43ca51eeeb9ff58e8)
+++ contrib/arch/uspace/srv/console/console.bp	(revision 1993f9a68ff3c23290d79db8b57db81b201848c4)
@@ -2,41 +2,41 @@
 !kbd.IPC_CONNECT_TO_ME ;
 !ns.IPC_CONNECT_ME_TO /* fb */ ;
-[devmap_driver_register] ;
+[/uspace/lib/libc/fnc.devmap_driver_register] ;
 !fb.FB_GET_RESOLUTION ;
 (
-	[vp_create] +
-	[vp_switch]
+	[fnc.vp_create] +
+	[fnc.vp_switch]
 )* ;
-[make_pixmap]* ;
-[make_anim] ;
-[vp_switch] ;
+[fnc.make_pixmap]* ;
+[fnc.make_anim] ;
+[fnc.vp_switch] ;
 !fb.FB_FLUSH ;
 !fb.FB_GET_CSIZE ;
 !fb.FB_GET_COLOR_CAP ;
 !fb.IPC_M_SHARE_OUT ;
-[devmap_device_register]* ;
-[gcons_redraw_console] ;
-[set_rgb_color] ;
-[screen_clear] ;
-[curs_goto] ;
-[curs_visibility] ;
+[/uspace/lib/libc/fnc.devmap_device_register]* ;
+[fnc.gcons_redraw_console] ;
+[fnc.set_rgb_color] ;
+[fnc.screen_clear] ;
+[fnc.curs_goto] ;
+[fnc.curs_visibility] ;
 (
 	?console.IPC_M_CONNECT_ME_TO ;
-	[gcons_notify_connect] ;
+	[fnc.gcons_notify_connect] ;
 	(
 		?console.VFS_OUT_READ {
-			[cons_read]
+			[fnc.cons_read]
 		} +
 		
 		?console.VFS_OUT_WRITE {
-			[cons_write]
+			[fnc.cons_write]
 		} +
 		
 		?console.VFS_OUT_SYNC {
-			[fb_pending_flush] ;
+			[fnc.fb_pending_flush] ;
 			(
 				(
 					!fb.FB_FLUSH ;
-					[curs_goto]
+					[fnc.curs_goto]
 				) +
 				NULL
@@ -59,7 +59,7 @@
 		
 		?console.CONSOLE_SET_STYLE {
-			[fb_pending_flush] ;
+			[fnc.fb_pending_flush] ;
 			(
-				[set_style] +
+				[fnc.set_style] +
 				NULL
 			)
@@ -67,7 +67,7 @@
 		
 		?console.CONSOLE_SET_COLOR {
-			[fb_pending_flush] ;
+			[fnc.fb_pending_flush] ;
 			(
-				[set_color] +
+				[fnc.set_color] +
 				NULL
 			)
@@ -75,7 +75,7 @@
 		
 		?console.CONSOLE_SET_RGB_COLOR {
-			[fb_pending_flush] ;
+			[fnc.fb_pending_flush] ;
 			(
-				[set_rgb_color] +
+				[fnc.set_rgb_color] +
 				NULL
 			)
@@ -83,7 +83,7 @@
 		
 		?console.CONSOLE_CURSOR_VISIBILITY {
-			[fb_pending_flush] ;
+			[fnc.fb_pending_flush] ;
 			(
-				[curs_visibility] +
+				[fnc.curs_visibility] +
 				NULL
 			)
@@ -97,5 +97,5 @@
 	
 	?console.IPC_M_PHONE_HUNGUP {
-		[gcons_notify_disconnect]
+		[fnc.gcons_notify_disconnect]
 	}
 )*
Index: ntrib/arch/uspace/srv/console/curs_goto
===================================================================
--- contrib/arch/uspace/srv/console/curs_goto	(revision ec8bab59255734063dbf86e43ca51eeeb9ff58e8)
+++ 	(revision )
@@ -1,1 +1,0 @@
-!fb.FB_CURSOR_GOTO
Index: ntrib/arch/uspace/srv/console/curs_visibility
===================================================================
--- contrib/arch/uspace/srv/console/curs_visibility	(revision ec8bab59255734063dbf86e43ca51eeeb9ff58e8)
+++ 	(revision )
@@ -1,1 +1,0 @@
-!fb.FB_CURSOR_VISIBILITY
Index: ntrib/arch/uspace/srv/console/draw_pixmap
===================================================================
--- contrib/arch/uspace/srv/console/draw_pixmap	(revision ec8bab59255734063dbf86e43ca51eeeb9ff58e8)
+++ 	(revision )
@@ -1,4 +1,0 @@
-!fb.FB_PREPARE_SHM ;
-!fb.IPC_M_SHARE_OUT ;
-!fb.FB_DRAW_PPM ;
-!fb.FB_DROP_SHM
Index: ntrib/arch/uspace/srv/console/fb_pending_flush
===================================================================
--- contrib/arch/uspace/srv/console/fb_pending_flush	(revision ec8bab59255734063dbf86e43ca51eeeb9ff58e8)
+++ 	(revision )
@@ -1,1 +1,0 @@
-!fb.FB_DRAW_TEXT_DATA
Index: contrib/arch/uspace/srv/console/fnc.cell_mark_changed
===================================================================
--- contrib/arch/uspace/srv/console/fnc.cell_mark_changed	(revision 1993f9a68ff3c23290d79db8b57db81b201848c4)
+++ contrib/arch/uspace/srv/console/fnc.cell_mark_changed	(revision 1993f9a68ff3c23290d79db8b57db81b201848c4)
@@ -0,0 +1,3 @@
+tentative {
+	[fnc.fb_pending_flush]
+}
Index: contrib/arch/uspace/srv/console/fnc.clear
===================================================================
--- contrib/arch/uspace/srv/console/fnc.clear	(revision 1993f9a68ff3c23290d79db8b57db81b201848c4)
+++ contrib/arch/uspace/srv/console/fnc.clear	(revision 1993f9a68ff3c23290d79db8b57db81b201848c4)
@@ -0,0 +1,1 @@
+!fb.clear
Index: contrib/arch/uspace/srv/console/fnc.cons_read
===================================================================
--- contrib/arch/uspace/srv/console/fnc.cons_read	(revision 1993f9a68ff3c23290d79db8b57db81b201848c4)
+++ contrib/arch/uspace/srv/console/fnc.cons_read	(revision 1993f9a68ff3c23290d79db8b57db81b201848c4)
@@ -0,0 +1,1 @@
+?ipc_m_data_read
Index: contrib/arch/uspace/srv/console/fnc.cons_write
===================================================================
--- contrib/arch/uspace/srv/console/fnc.cons_write	(revision 1993f9a68ff3c23290d79db8b57db81b201848c4)
+++ contrib/arch/uspace/srv/console/fnc.cons_write	(revision 1993f9a68ff3c23290d79db8b57db81b201848c4)
@@ -0,0 +1,3 @@
+?ipc_m_data_write ;
+[fnc.write_char]* ;
+[fnc.gcons_notify_char]
Index: contrib/arch/uspace/srv/console/fnc.curs_goto
===================================================================
--- contrib/arch/uspace/srv/console/fnc.curs_goto	(revision 1993f9a68ff3c23290d79db8b57db81b201848c4)
+++ contrib/arch/uspace/srv/console/fnc.curs_goto	(revision 1993f9a68ff3c23290d79db8b57db81b201848c4)
@@ -0,0 +1,1 @@
+!fb.cursor_goto
Index: contrib/arch/uspace/srv/console/fnc.curs_visibility
===================================================================
--- contrib/arch/uspace/srv/console/fnc.curs_visibility	(revision 1993f9a68ff3c23290d79db8b57db81b201848c4)
+++ contrib/arch/uspace/srv/console/fnc.curs_visibility	(revision 1993f9a68ff3c23290d79db8b57db81b201848c4)
@@ -0,0 +1,1 @@
+!fb.cursor_visibility
Index: contrib/arch/uspace/srv/console/fnc.draw_pixmap
===================================================================
--- contrib/arch/uspace/srv/console/fnc.draw_pixmap	(revision 1993f9a68ff3c23290d79db8b57db81b201848c4)
+++ contrib/arch/uspace/srv/console/fnc.draw_pixmap	(revision 1993f9a68ff3c23290d79db8b57db81b201848c4)
@@ -0,0 +1,4 @@
+!fb.prepare_shm ;
+!fb.ipc_m_share_out ;
+!fb.draw_ppm ;
+!fb.drop_shm
Index: contrib/arch/uspace/srv/console/fnc.fb_pending_flush
===================================================================
--- contrib/arch/uspace/srv/console/fnc.fb_pending_flush	(revision 1993f9a68ff3c23290d79db8b57db81b201848c4)
+++ contrib/arch/uspace/srv/console/fnc.fb_pending_flush	(revision 1993f9a68ff3c23290d79db8b57db81b201848c4)
@@ -0,0 +1,1 @@
+!fb.draw_text_data
Index: contrib/arch/uspace/srv/console/fnc.gcons_notify_char
===================================================================
--- contrib/arch/uspace/srv/console/fnc.gcons_notify_char	(revision 1993f9a68ff3c23290d79db8b57db81b201848c4)
+++ contrib/arch/uspace/srv/console/fnc.gcons_notify_char	(revision 1993f9a68ff3c23290d79db8b57db81b201848c4)
@@ -0,0 +1,4 @@
+tentative {
+	[fnc.redraw_state] ;
+	[fnc.vp_switch]
+}
Index: contrib/arch/uspace/srv/console/fnc.gcons_notify_connect
===================================================================
--- contrib/arch/uspace/srv/console/fnc.gcons_notify_connect	(revision 1993f9a68ff3c23290d79db8b57db81b201848c4)
+++ contrib/arch/uspace/srv/console/fnc.gcons_notify_connect	(revision 1993f9a68ff3c23290d79db8b57db81b201848c4)
@@ -0,0 +1,4 @@
+tentative {
+	[fnc.redraw_state] ;
+	[fnc.vp_switch]
+}
Index: contrib/arch/uspace/srv/console/fnc.gcons_notify_disconnect
===================================================================
--- contrib/arch/uspace/srv/console/fnc.gcons_notify_disconnect	(revision 1993f9a68ff3c23290d79db8b57db81b201848c4)
+++ contrib/arch/uspace/srv/console/fnc.gcons_notify_disconnect	(revision 1993f9a68ff3c23290d79db8b57db81b201848c4)
@@ -0,0 +1,4 @@
+tentative {
+	[fnc.redraw_state] ;
+	[fnc.vp_switch]
+}
Index: contrib/arch/uspace/srv/console/fnc.gcons_redraw_console
===================================================================
--- contrib/arch/uspace/srv/console/fnc.gcons_redraw_console	(revision 1993f9a68ff3c23290d79db8b57db81b201848c4)
+++ contrib/arch/uspace/srv/console/fnc.gcons_redraw_console	(revision 1993f9a68ff3c23290d79db8b57db81b201848c4)
@@ -0,0 +1,9 @@
+tentative {
+	[fnc.vp_switch] ;
+	[fnc.set_rgb_color] ;
+	[fnc.clear] ;
+	[fnc.draw_pixmap] ;
+	[fnc.draw_pixmap] ;
+	[fnc.redraw_state]* ;
+	[fnc.vp_switch]
+}
Index: contrib/arch/uspace/srv/console/fnc.make_anim
===================================================================
--- contrib/arch/uspace/srv/console/fnc.make_anim	(revision 1993f9a68ff3c23290d79db8b57db81b201848c4)
+++ contrib/arch/uspace/srv/console/fnc.make_anim	(revision 1993f9a68ff3c23290d79db8b57db81b201848c4)
@@ -0,0 +1,4 @@
+!fb.anim_create ;
+[fnc.make_pixmap]* ;
+!fb.anim_add_pixmap ;
+!fb.anim_start
Index: contrib/arch/uspace/srv/console/fnc.make_pixmap
===================================================================
--- contrib/arch/uspace/srv/console/fnc.make_pixmap	(revision 1993f9a68ff3c23290d79db8b57db81b201848c4)
+++ contrib/arch/uspace/srv/console/fnc.make_pixmap	(revision 1993f9a68ff3c23290d79db8b57db81b201848c4)
@@ -0,0 +1,4 @@
+!fb.prepare_shm ;
+!fb.ipc_m_share_out ;
+!fb.shm2pixmap ;
+!fb.drop_shm
Index: contrib/arch/uspace/srv/console/fnc.redraw_state
===================================================================
--- contrib/arch/uspace/srv/console/fnc.redraw_state	(revision 1993f9a68ff3c23290d79db8b57db81b201848c4)
+++ contrib/arch/uspace/srv/console/fnc.redraw_state	(revision 1993f9a68ff3c23290d79db8b57db81b201848c4)
@@ -0,0 +1,7 @@
+[fnc.vp_switch] ;
+tentative {
+	!fb.FB_VP_DRAW_PIXMAP
+} ;
+tentative {
+	!fb.FB_PUTCHAR*
+}
Index: contrib/arch/uspace/srv/console/fnc.screen_clear
===================================================================
--- contrib/arch/uspace/srv/console/fnc.screen_clear	(revision 1993f9a68ff3c23290d79db8b57db81b201848c4)
+++ contrib/arch/uspace/srv/console/fnc.screen_clear	(revision 1993f9a68ff3c23290d79db8b57db81b201848c4)
@@ -0,0 +1,1 @@
+!fb.clear
Index: contrib/arch/uspace/srv/console/fnc.set_color
===================================================================
--- contrib/arch/uspace/srv/console/fnc.set_color	(revision 1993f9a68ff3c23290d79db8b57db81b201848c4)
+++ contrib/arch/uspace/srv/console/fnc.set_color	(revision 1993f9a68ff3c23290d79db8b57db81b201848c4)
@@ -0,0 +1,1 @@
+!fb.set_color
Index: contrib/arch/uspace/srv/console/fnc.set_rgb_color
===================================================================
--- contrib/arch/uspace/srv/console/fnc.set_rgb_color	(revision 1993f9a68ff3c23290d79db8b57db81b201848c4)
+++ contrib/arch/uspace/srv/console/fnc.set_rgb_color	(revision 1993f9a68ff3c23290d79db8b57db81b201848c4)
@@ -0,0 +1,1 @@
+!fb.set_rgb_color
Index: contrib/arch/uspace/srv/console/fnc.set_style
===================================================================
--- contrib/arch/uspace/srv/console/fnc.set_style	(revision 1993f9a68ff3c23290d79db8b57db81b201848c4)
+++ contrib/arch/uspace/srv/console/fnc.set_style	(revision 1993f9a68ff3c23290d79db8b57db81b201848c4)
@@ -0,0 +1,1 @@
+!fb.set_style
Index: contrib/arch/uspace/srv/console/fnc.vp_create
===================================================================
--- contrib/arch/uspace/srv/console/fnc.vp_create	(revision 1993f9a68ff3c23290d79db8b57db81b201848c4)
+++ contrib/arch/uspace/srv/console/fnc.vp_create	(revision 1993f9a68ff3c23290d79db8b57db81b201848c4)
@@ -0,0 +1,1 @@
+!fb.viewport_create
Index: contrib/arch/uspace/srv/console/fnc.vp_switch
===================================================================
--- contrib/arch/uspace/srv/console/fnc.vp_switch	(revision 1993f9a68ff3c23290d79db8b57db81b201848c4)
+++ contrib/arch/uspace/srv/console/fnc.vp_switch	(revision 1993f9a68ff3c23290d79db8b57db81b201848c4)
@@ -0,0 +1,1 @@
+!fb.viewport_switch
Index: contrib/arch/uspace/srv/console/fnc.write_char
===================================================================
--- contrib/arch/uspace/srv/console/fnc.write_char	(revision 1993f9a68ff3c23290d79db8b57db81b201848c4)
+++ contrib/arch/uspace/srv/console/fnc.write_char	(revision 1993f9a68ff3c23290d79db8b57db81b201848c4)
@@ -0,0 +1,13 @@
+(
+	[fnc.fb_pending_flush] +
+	[fnc.cell_mark_changed]
+) ;
+tentative {
+	[fnc.fb_pending_flush] ;
+	tentative {
+		!fb.scroll +
+	}
+} ;
+tentative {
+	[fnc.curs_goto]
+}
Index: ntrib/arch/uspace/srv/console/gcons_notify_connect
===================================================================
--- contrib/arch/uspace/srv/console/gcons_notify_connect	(revision ec8bab59255734063dbf86e43ca51eeeb9ff58e8)
+++ 	(revision )
@@ -1,5 +1,0 @@
-(
-	[redraw_state] ;
-	[vp_switch]
-) +
-NULL
Index: ntrib/arch/uspace/srv/console/gcons_notify_disconnect
===================================================================
--- contrib/arch/uspace/srv/console/gcons_notify_disconnect	(revision ec8bab59255734063dbf86e43ca51eeeb9ff58e8)
+++ 	(revision )
@@ -1,5 +1,0 @@
-(
-	[redraw_state] ;
-	[vp_switch]
-) +
-NULL
Index: ntrib/arch/uspace/srv/console/gcons_redraw_console
===================================================================
--- contrib/arch/uspace/srv/console/gcons_redraw_console	(revision ec8bab59255734063dbf86e43ca51eeeb9ff58e8)
+++ 	(revision )
@@ -1,10 +1,0 @@
-(
-	[vp_switch] ;
-	[set_rgb_color] ;
-	[clear] ;
-	[draw_pixmap] ;
-	[draw_pixmap] ;
-	[redraw_state]* ;
-	[vp_switch]
-) +
-NULL
Index: ntrib/arch/uspace/srv/console/make_anim
===================================================================
--- contrib/arch/uspace/srv/console/make_anim	(revision ec8bab59255734063dbf86e43ca51eeeb9ff58e8)
+++ 	(revision )
@@ -1,4 +1,0 @@
-!fb.FB_ANIM_CREATE ;
-[make_pixmap]* ;
-!fb.FB_ANIM_ADDPIXMAP ;
-!fb.FB_ANIM_START
Index: ntrib/arch/uspace/srv/console/make_pixmap
===================================================================
--- contrib/arch/uspace/srv/console/make_pixmap	(revision ec8bab59255734063dbf86e43ca51eeeb9ff58e8)
+++ 	(revision )
@@ -1,4 +1,0 @@
-!fb.FB_PREPARE_SHM ;
-!fb.IPC_M_SHARE_OUT ;
-!fb.FB_SHM2PIXMAP ;
-!fb.FB_DROP_SHM
Index: ntrib/arch/uspace/srv/console/redraw_state
===================================================================
--- contrib/arch/uspace/srv/console/redraw_state	(revision ec8bab59255734063dbf86e43ca51eeeb9ff58e8)
+++ 	(revision )
@@ -1,11 +1,0 @@
-[vp_switch] ;
-(
-	!fb.FB_VP_DRAW_PIXMAP +
-	NULL
-) ;
-(
-	(
-		!fb.FB_PUTCHAR*
-	) +
-	NULL
-)
Index: ntrib/arch/uspace/srv/console/screen_clear
===================================================================
--- contrib/arch/uspace/srv/console/screen_clear	(revision ec8bab59255734063dbf86e43ca51eeeb9ff58e8)
+++ 	(revision )
@@ -1,1 +1,0 @@
-!fb.FB_CLEAR
Index: ntrib/arch/uspace/srv/console/set_color
===================================================================
--- contrib/arch/uspace/srv/console/set_color	(revision ec8bab59255734063dbf86e43ca51eeeb9ff58e8)
+++ 	(revision )
@@ -1,1 +1,0 @@
-!fb.FB_SET_COLOR
Index: ntrib/arch/uspace/srv/console/set_rgb_color
===================================================================
--- contrib/arch/uspace/srv/console/set_rgb_color	(revision ec8bab59255734063dbf86e43ca51eeeb9ff58e8)
+++ 	(revision )
@@ -1,1 +1,0 @@
-!fb.FB_SET_RGB_COLOR
Index: ntrib/arch/uspace/srv/console/set_style
===================================================================
--- contrib/arch/uspace/srv/console/set_style	(revision ec8bab59255734063dbf86e43ca51eeeb9ff58e8)
+++ 	(revision )
@@ -1,1 +1,0 @@
-!fb.FB_SET_STYLE
Index: ntrib/arch/uspace/srv/console/vp_create
===================================================================
--- contrib/arch/uspace/srv/console/vp_create	(revision ec8bab59255734063dbf86e43ca51eeeb9ff58e8)
+++ 	(revision )
@@ -1,1 +1,0 @@
-!fb.FB_VIEWPORT_CREATE
Index: ntrib/arch/uspace/srv/console/vp_switch
===================================================================
--- contrib/arch/uspace/srv/console/vp_switch	(revision ec8bab59255734063dbf86e43ca51eeeb9ff58e8)
+++ 	(revision )
@@ -1,1 +1,0 @@
-!fb.FB_VIEWPORT_SWITCH
Index: ntrib/arch/uspace/srv/console/write_char
===================================================================
--- contrib/arch/uspace/srv/console/write_char	(revision ec8bab59255734063dbf86e43ca51eeeb9ff58e8)
+++ 	(revision )
@@ -1,18 +1,0 @@
-(
-	[fb_pending_flush] +
-	[cell_mark_changed]
-) ;
-(
-	(
-		[fb_pending_flush] ;
-		(
-			!fb.FB_SCROLL +
-			NULL
-		)
-	) +
-	NULL
-) ;
-(
-	[curs_goto] +
-	NULL
-)
Index: contrib/arch/uspace/srv/devmap/devmap.adl
===================================================================
--- contrib/arch/uspace/srv/devmap/devmap.adl	(revision ec8bab59255734063dbf86e43ca51eeeb9ff58e8)
+++ contrib/arch/uspace/srv/devmap/devmap.adl	(revision 1993f9a68ff3c23290d79db8b57db81b201848c4)
@@ -4,5 +4,5 @@
 		
 		/* Register as a new driver */
-		ipcarg_t driver_register(void);
+		ipcarg_t driver_register(in_copy string name);
 		
 		/* Unregister all devices and the driver itself */
@@ -10,5 +10,5 @@
 		
 		/* Register new device and return handle */
-		ipcarg_t device_register(out ipcarg_t handle);
+		ipcarg_t device_register(in_copy string name, out ipcarg_t handle);
 		
 		/* Unregister device */
@@ -16,11 +16,8 @@
 		
 		/* Resolve device name to handle */
-		ipcarg_t device_get_handle(in ipcarg_t flags);
+		ipcarg_t device_get_handle(in ipcarg_t flags, in_copy string name);
 		
 		/* Get device name for a given handle */
 		ipcarg_t device_get_name(in ipcarg_t handle);
-		
-		/* Transfer driver or device name */
-		ipcarg_t ipc_m_data_write(in ipcarg_t src_addr, in ipcarg_t src_size, out ipcarg_t dst_addr, out ipcarg_t dst_size);
 		
 		/* Close connection */
@@ -35,5 +32,5 @@
 		
 		/* Resolve device name to handle */
-		ipcarg_t device_get_handle(in ipcarg_t flags);
+		ipcarg_t device_get_handle(in ipcarg_t flags, in_copy string name);
 		
 		/* Get device name for a given handle */
@@ -50,11 +47,5 @@
 		
 		/* Get an array of (device_name, handle) pairs */
-		ipcarg_t device_get_devices(void)
-		
-		/* Transfer device name from client */
-		ipcarg_t ipc_m_data_write(in ipcarg_t src_addr, in ipcarg_t src_size, out ipcarg_t dst_addr, out ipcarg_t dst_size);
-		
-		/* Transfer (device_name, handle) pairs to client */
-		ipcarg_t ipc_m_data_read(in ipcarg_t src_addr, in ipcarg_t src_size, out ipcarg_t dst_addr, out ipcarg_t dst_size);
+		ipcarg_t device_get_devices(out_copy stream data)
 		
 		/* Close connection */
@@ -70,5 +61,5 @@
 		device_mapper_client dm_client;
 	requires:
-		[/lib/libc/iface.requires]
+		[/uspace/lib/libc/requires%]
 	protocol:
 		[devmap.bp]
Index: contrib/arch/uspace/srv/fs/devfs/devfs.bp
===================================================================
--- contrib/arch/uspace/srv/fs/devfs/devfs.bp	(revision ec8bab59255734063dbf86e43ca51eeeb9ff58e8)
+++ contrib/arch/uspace/srv/fs/devfs/devfs.bp	(revision 1993f9a68ff3c23290d79db8b57db81b201848c4)
@@ -1,5 +1,5 @@
-[../../../lib/libc/devmap_get_phone] ;
+[/uspace/lib/libc/fnc.devmap_get_phone] ;
 !ns.IPC_M_CONNECT_ME_TO /* vfs */ ;
-[../../../lib/libfs/fs_register] ;
+[/uspace/lib/libfs/fnc.fs_register] ;
 (
 	?fs.IPC_M_CONNECT_ME_TO ;
@@ -13,6 +13,6 @@
 		?fs.VFS_OUT_LOOKUP {
 			(
-				[../../../lib/libc/devmap_device_get_handle] ;
-				[../../../lib/libc/devmap_device_connect]
+				[/uspace/lib/libc/fnc.devmap_device_get_handle] ;
+				[/uspace/lib/libc/fnc.devmap_device_connect]
 			) +
 			NULL
@@ -26,6 +26,6 @@
 				) +
 				(
-					[../../../lib/libc/devmap_device_get_count] ;
-					[../../../lib/libc/devmap_device_get_devices]
+					[/uspace/lib/libc/fnc.devmap_device_get_count] ;
+					[/uspace/lib/libc/fnc.devmap_device_get_devices]
 				)
 			}
@@ -51,5 +51,5 @@
 		
 		?fs.VFS_OUT_OPEN_NODE {
-			[../../../lib/libc/devmap_device_connect] +
+			[/uspace/lib/libc/fnc.devmap_device_connect] +
 			NULL
 		} +
Index: contrib/arch/uspace/srv/fs/fat/fat.bp
===================================================================
--- contrib/arch/uspace/srv/fs/fat/fat.bp	(revision ec8bab59255734063dbf86e43ca51eeeb9ff58e8)
+++ contrib/arch/uspace/srv/fs/fat/fat.bp	(revision 1993f9a68ff3c23290d79db8b57db81b201848c4)
@@ -1,4 +1,4 @@
 !ns.IPC_M_CONNECT_ME_TO /* vfs */ ;
-[../../../lib/libfs/fs_register] ;
+[/uspace/lib/libfs/fnc.fs_register] ;
 (
 	?fs.IPC_M_CONNECT_ME_TO ;
@@ -9,9 +9,9 @@
 		
 		?fs.VFS_OUT_MOUNT {
-			[../../../lib/libfs/libfs_mount]
+			[/uspace/lib/libfs/fnc.libfs_mount]
 		} +
 		
 		?fs.VFS_OUT_LOOKUP {
-			[../../../lib/libfs/libfs_lookup]
+			[/uspace/lib/libfs/fnc.libfs_lookup]
 		} +
 		
@@ -31,9 +31,9 @@
 		
 		?fs.VFS_OUT_OPEN_NODE {
-			[../../../lib/libfs/libfs_open_node]
+			[/uspace/lib/libfs/fnc.libfs_open_node]
 		} +
 		
 		?fs.VFS_OUT_STAT {
-			[../../../lib/libfs/libfs_stat]
+			[/uspace/lib/libfs/fnc.libfs_stat]
 		} +
 		
Index: contrib/arch/uspace/srv/fs/tmpfs/tmpfs.bp
===================================================================
--- contrib/arch/uspace/srv/fs/tmpfs/tmpfs.bp	(revision ec8bab59255734063dbf86e43ca51eeeb9ff58e8)
+++ contrib/arch/uspace/srv/fs/tmpfs/tmpfs.bp	(revision 1993f9a68ff3c23290d79db8b57db81b201848c4)
@@ -1,4 +1,4 @@
 !ns.IPC_M_CONNECT_ME_TO /* vfs */ ;
-[../../../lib/libfs/fs_register] ;
+[/uspace/lib/libfs/fnc.fs_register] ;
 (
 	?fs.IPC_M_CONNECT_ME_TO ;
@@ -9,9 +9,9 @@
 		
 		?fs.VFS_OUT_MOUNT {
-			[../../../lib/libfs/libfs_mount]
+			[/uspace/lib/libfs/fnc.libfs_mount]
 		} +
 		
 		?fs.VFS_OUT_LOOKUP {
-			[../../../lib/libfs/libfs_lookup]
+			[/uspace/lib/libfs/fnc.libfs_lookup]
 		} +
 		
@@ -31,9 +31,9 @@
 		
 		?fs.VFS_OUT_OPEN_NODE {
-			[../../../lib/libfs/libfs_open_node]
+			[/uspace/lib/libfs/fnc.libfs_open_node]
 		} +
 		
 		?fs.VFS_OUT_STAT {
-			[../../../lib/libfs/libfs_stat]
+			[/uspace/lib/libfs/fnc.libfs_stat]
 		} +
 		
Index: contrib/arch/uspace/srv/vfs/fnc.vfs_grab_phone
===================================================================
--- contrib/arch/uspace/srv/vfs/fnc.vfs_grab_phone	(revision 1993f9a68ff3c23290d79db8b57db81b201848c4)
+++ contrib/arch/uspace/srv/vfs/fnc.vfs_grab_phone	(revision 1993f9a68ff3c23290d79db8b57db81b201848c4)
@@ -0,0 +1,1 @@
+!fs.ipc_m_connect_me_to
Index: contrib/arch/uspace/srv/vfs/fnc.vfs_lookup_internal
===================================================================
--- contrib/arch/uspace/srv/vfs/fnc.vfs_lookup_internal	(revision 1993f9a68ff3c23290d79db8b57db81b201848c4)
+++ contrib/arch/uspace/srv/vfs/fnc.vfs_lookup_internal	(revision 1993f9a68ff3c23290d79db8b57db81b201848c4)
@@ -0,0 +1,3 @@
+[fnc.vfs_grab_phone] ;
+!fs.lookup ;
+[fnc.vfs_release_phone]
Index: contrib/arch/uspace/srv/vfs/fnc.vfs_open_node_internal
===================================================================
--- contrib/arch/uspace/srv/vfs/fnc.vfs_open_node_internal	(revision 1993f9a68ff3c23290d79db8b57db81b201848c4)
+++ contrib/arch/uspace/srv/vfs/fnc.vfs_open_node_internal	(revision 1993f9a68ff3c23290d79db8b57db81b201848c4)
@@ -0,0 +1,3 @@
+[fnc.vfs_grab_phone] ;
+!fs.open_node ;
+[fnc.vfs_release_phone]
Index: contrib/arch/uspace/srv/vfs/fnc.vfs_release_phone
===================================================================
--- contrib/arch/uspace/srv/vfs/fnc.vfs_release_phone	(revision 1993f9a68ff3c23290d79db8b57db81b201848c4)
+++ contrib/arch/uspace/srv/vfs/fnc.vfs_release_phone	(revision 1993f9a68ff3c23290d79db8b57db81b201848c4)
@@ -0,0 +1,1 @@
+!fs.ipc_m_phone_hungup
Index: contrib/arch/uspace/srv/vfs/vfs.adl
===================================================================
--- contrib/arch/uspace/srv/vfs/vfs.adl	(revision 1993f9a68ff3c23290d79db8b57db81b201848c4)
+++ contrib/arch/uspace/srv/vfs/vfs.adl	(revision 1993f9a68ff3c23290d79db8b57db81b201848c4)
@@ -0,0 +1,65 @@
+interface vfs {
+		/* Establish connection */
+		ipcarg_t ipc_m_connect_me_to(void);
+		
+		/* Register a filesystem driver */
+		ipcarg_t register(in_copy string name);
+		
+		/* Mount filesystem */
+		ipcarg_t mount(in ipcarg_t device, in ipcarg_t flags, in_copy string point, in_copy string opts, in_copy string fs);
+		
+		/* Open file */
+		ipcarg_t open(in ipcarg_t lflag, in ipcarg_t oflag, in ipcarg_t mode, in_copy string path, out ipcarg_t fd);
+		
+		/* Open file using node */
+		ipcarg_t open_node(in ipcarg_t fs_handle, in ipcarg_t dev_handle, in ipcarg_t index, in ipcarg_t oflag, out ipcarg_t fd);
+		
+		/* Read data from file */
+		ipcarg_t read(in ipcarg_t fd, out_copy stream data);
+		
+		/* Write data to file */
+		ipcarg_t write(in ipcarg_t fd, in_copy stream data);
+		
+		/* Seek in file */
+		ipcarg_t seek(in ipcarg_t fd, in ipcarg_t offset, in ipcarg_t whence);
+		
+		/* Truncate file */
+		ipcarg_t truncate(in ipcarg_t fd, in ipcarg_t size);
+		
+		/* Get file metadata */
+		ipcarg_t fstat(in ipcarg_t fd, out_copy stream stat);
+		
+		/* Get directory entry metadata */
+		ipcarg_t stat(in_copy string path, out_copy stream stat);
+		
+		/* Create directory */
+		ipcarg_t mkdir(in ipcarg_t mode, in_copy string path);
+		
+		/* Delete directory entry */
+		ipcarg_t unlink(in ipcarg_t lflag, in_copy string path);
+		
+		/* Rename directory entry */
+		ipcarg_t rename(in_copy string old, in_copy string new);
+		
+		/* Flush file buffers */
+		ipcarg_t sync(in ipcarg_t fd);
+		
+		/* In-protocol status value */
+		ipcarg_t ipc_m_ping(void);
+		
+		/* Close connection */
+		ipcarg_t ipc_m_phone_hungup(void);
+	protocol:
+		[virtual_fs.bp]
+};
+
+frame vfs {
+	provides:
+		vfs vfs;
+	requires:
+		[/uspace/lib/libc/requires%]
+		naming_service ns;
+	protocol:
+		[/uspace/lib/libc/protocol] +
+		[vfs.bp]
+};
Index: contrib/arch/uspace/srv/vfs/vfs.bp
===================================================================
--- contrib/arch/uspace/srv/vfs/vfs.bp	(revision ec8bab59255734063dbf86e43ca51eeeb9ff58e8)
+++ contrib/arch/uspace/srv/vfs/vfs.bp	(revision 1993f9a68ff3c23290d79db8b57db81b201848c4)
@@ -1,131 +1,1 @@
-!ns.IPC_M_CONNECT_TO_ME ;
-(
-	?vfs.IPC_M_CONNECT_ME_TO ;
-	(
-		?vfs.VFS_IN_REGISTER {
-			?vfs.IPC_M_DATA_WRITE ;
-			?vfs.IPC_M_CONNECT_TO_ME ;
-			?vfs.IPC_M_SHARE_IN
-		} +
-		
-		?vfs.VFS_IN_MOUNT {
-			?vfs.IPC_M_DATA_WRITE /* mount point */ ;
-			?vfs.IPC_M_DATA_WRITE /* mount options */ ;
-			?vfs.IPC_M_DATA_WRITE /* fs name */ ;
-			?vfs.IPC_M_PING ;
-			(
-				
-				!fs.VFS_OUT_MOUNTED ;
-				!fs.IPC_M_DATA_WRITE /* mount options */
-			) /* root fs */ +
-			(
-				!fs.VFS_OUT_MOUNT ;
-				!fs.IPC_M_CONNECTION_CLONE ;
-				!fs.VFS_M_DATA_WRITE /* mount options */
-			) /* non-root fs */
-		} +
-		
-		?vfs.VFS_IN_OPEN {
-			?vfs.IPC_M_DATA_WRITE /* path */ ;
-			[vfs_lookup_internal] ;
-			(
-				(
-					[vfs_grab_phone] ;
-					!fs.VFS_OUT_TRUNCATE ;
-					[vfs_release_phone]
-				) +
-				NULL
-			)
-		} +
-		
-		?vfs.VFS_IN_OPEN_NODE {
-			[vfs_grab_phone] ;
-			!fs.VFS_OUT_OPEN_NODE ;
-			[vfs_release_phone] ;
-			(
-				(
-					[vfs_grab_phone] ;
-					!fs.VFS_OUT_TRUNCATE ;
-					[vfs_release_phone]
-				) +
-				NULL
-			)
-		} +
-		
-		?vfs.VFS_IN_CLOSE {
-			[vfs_grab_phone] ;
-			!fs.VFS_OUT_CLOSE ;
-			[vfs_release_phone]
-		} +
-		
-		?vfs.VFS_IN_READ {
-			?vfs.IPC_M_DATA_READ {
-				[vfs_grab_phone] ;
-				!fs.VFS_OUT_READ /* payload */ ;
-				!fs.IPC_M_DATA_READ /* forwarded */ ;
-				[vfs_release_phone]
-			}
-		} +
-		
-		?vfs.VFS_IN_WRITE {
-			?vfs.IPC_M_DATA_WRITE {
-				[vfs_grab_phone] ;
-				!fs.VFS_OUT_WRITE /* payload */ ;
-				!fs.IPC_M_DATA_WRITE /* forwarded */ ;
-				[vfs_release_phone]
-			}
-		} +
-		
-		?vfs.VFS_IN_SEEK +
-		
-		?vfs.VFS_IN_TRUNCATE {
-			[vfs_grab_phone] ;
-			!fs.VFS_OUT_TRUNCATE ;
-			[vfs_release_phone]
-		} +
-		
-		?vfs.VFS_IN_FSTAT {
-			?vfs.IPC_M_DATA_READ /* struct stat */ {
-				[vfs_grab_phone] ;
-				!fs.VFS_OUT_STAT ;
-				!fs.IPC_M_DATA_READ /* forwarded */ ;
-				[vfs_release_phone]
-			}
-		} +
-		
-		?vfs.VFS_IN_STAT {
-			?vfs.IPC_M_DATA_WRITE /* path */ ;
-			?vfs.IPC_M_DATA_READ /* struct stat */ {
-				[vfs_lookup_internal] ;
-				!fs.VFS_OUT_STAT ;
-				!fs.IPC_M_DATA_READ /* forwarded */
-			}
-		} +
-		
-		?vfs.VFS_IN_MKDIR {
-			?vfs.IPC_M_DATA_WRITE /* path */ ;
-			[vfs_lookup_internal]
-		} +
-		
-		?vfs.VFS_IN_UNLINK {
-			?vfs.IPC_M_DATA_WRITE /* path */ ;
-			[vfs_lookup_internal]
-		} +
-		
-		?vfs.VFS_IN_RENAME {
-			?vfs.IPC_M_DATA_WRITE /* old path */ ;
-			?vfs.IPC_M_DATE_WRITE /* new path */ ;
-			[vfs_lookup_internal] /* lookup old path */ ;
-			[vfs_lookup_internal] /* lookup parent of new path */ ;
-			[vfs_lookup_internal] /* destroy old link for the new path */ ;
-			[vfs_lookup_internal] /* create new link for the new path */ ;
-			[vfs_lookup_internal] /* destroy link for the old path */
-		} +
-		
-		?vfs.VFS_IN_SYNC {
-			!fs.VFS_OUT_SYNC
-		}
-		
-	)* ;
-	?vfs.IPC_M_PHONE_HUNGUP
-)*
+!ns.ipc_m_connect_to_me
Index: ntrib/arch/uspace/srv/vfs/vfs_grab_phone
===================================================================
--- contrib/arch/uspace/srv/vfs/vfs_grab_phone	(revision ec8bab59255734063dbf86e43ca51eeeb9ff58e8)
+++ 	(revision )
@@ -1,1 +1,0 @@
-!fs.IPC_M_CONNECT_ME_TO
Index: ntrib/arch/uspace/srv/vfs/vfs_lookup_internal
===================================================================
--- contrib/arch/uspace/srv/vfs/vfs_lookup_internal	(revision ec8bab59255734063dbf86e43ca51eeeb9ff58e8)
+++ 	(revision )
@@ -1,3 +1,0 @@
-[vfs_grab_phone] ;
-!fs.VFS_OUT_LOOKUP ;
-[vfs_release_phone]
Index: ntrib/arch/uspace/srv/vfs/vfs_release_phone
===================================================================
--- contrib/arch/uspace/srv/vfs/vfs_release_phone	(revision ec8bab59255734063dbf86e43ca51eeeb9ff58e8)
+++ 	(revision )
@@ -1,1 +1,0 @@
-!fs.IPC_M_PHONE_HUNGUP
Index: contrib/arch/uspace/srv/vfs/virtual_fs.bp
===================================================================
--- contrib/arch/uspace/srv/vfs/virtual_fs.bp	(revision 1993f9a68ff3c23290d79db8b57db81b201848c4)
+++ contrib/arch/uspace/srv/vfs/virtual_fs.bp	(revision 1993f9a68ff3c23290d79db8b57db81b201848c4)
@@ -0,0 +1,179 @@
+?ipc_m_connect_me_to ;
+(
+	?register {
+		?ipc_m_data_write /* fs name */ ;
+		tentative {
+			/* callback connection */
+			?ipc_m_connect_to_me ;
+			?ipc_m_share_in
+		}
+	} +
+	
+	?mount {
+		?ipc_m_data_write /* mount point */ ;
+		tentative {
+			?ipc_m_data_write /* mount options */ ;
+			tentative {
+				?ipc_m_data_write /* fs name */ ;
+				tentative {
+					?ipc_m_ping ;
+					tentative {
+						(
+							/* root fs */
+							!fs.mounted ;
+							!fs.ipc_m_data_write /* mount options */
+						) +
+						(
+							/* non-root fs */
+							tentative {
+								[fnc.vfs_lookup_internal] ;
+								tentative {
+									[fnc.vfs_grab_phone] ;
+									[fnc.vfs_grab_phone] ;
+									!fs.mount ;
+									!fs.ipc_m_connection_clone ;
+									[fnc.vfs_release_phone] ;
+									tentative {
+										!fs.vfs_m_data_write /* mount options */
+									}
+									[fnc.vfs_release_phone] ;
+								}
+							}
+						)
+					}
+				}
+			}
+		}
+	} +
+	
+	?open {
+		tentative {
+			?ipc_m_data_write /* path */ ;
+			tentative {
+				[fnc.vfs_lookup_internal] ;
+				tentative {
+					[fnc.vfs_grab_phone] ;
+					!fs.truncate ;
+					[fnc.vfs_release_phone]
+				}
+			}
+		}
+	} +
+	
+	?open_node {
+		[fnc.vfs_open_node_internal] ;
+		tentative {
+			[fnc.vfs_grab_phone] ;
+			!fs.truncate ;
+			[fnc.vfs_release_phone]
+		}
+	} +
+	
+	?close {
+		tentative {
+			[fnc.vfs_grab_phone] ;
+			!fs.close ;
+			[fnc.vfs_release_phone]
+		}
+	} +
+	
+	?read {
+		tentative {
+			?ipc_m_data_read {
+				[fnc.vfs_grab_phone] ;
+				!fs.read ;
+				!fs.ipc_m_data_read /* forward payload */ ;
+				[fnc.vfs_release_phone]
+			}
+		}
+	} +
+	
+	?write {
+		tentative {
+			?ipc_m_data_write {
+				[fnc.vfs_grab_phone] ;
+				!fs.write ;
+				!fs.ipc_m_data_write /* forward payload */ ;
+				[fnc.vfs_release_phone]
+			}
+		}
+	} +
+	
+	?truncate {
+		tentative {
+			[fnc.vfs_grab_phone] ;
+			!fs.truncate ;
+			[fnc.vfs_release_phone]
+		}
+	} +
+	
+	?fstat {
+		tentative {
+			?ipc_m_data_read /* struct stat */ {
+				[fnc.vfs_grab_phone] ;
+				!fs.stat ;
+				!fs.ipc_m_data_read /* forward struct stat */ ;
+				[fnc.vfs_release_phone]
+			}
+		}
+	} +
+	
+	?stat {
+		?ipc_m_data_write /* path */ ;
+		tentative {
+			?ipc_m_data_read /* struct stat */ {
+				[fnc.vfs_lookup_internal] ;
+				tentative {
+					!fs.stat ;
+					!fs.ipc_m_data_read /* forward struct stat */
+				}
+			}
+		}
+	} +
+	
+	?mkdir {
+		?ipc_m_data_write /* path */ ;
+		tentative {
+			[fnc.vfs_lookup_internal]
+		}
+	} +
+	
+	?unlink {
+		?ipc_m_data_write /* path */ ;
+		tentative {
+			[fnc.vfs_lookup_internal]
+		}
+	} +
+	
+	?rename {
+		?ipc_m_data_write /* old path */ ;
+		tentative {
+			?ipc_m_data_write /* new path */ ;
+			tentative {
+				[fnc.vfs_lookup_internal] /* lookup old path */ ;
+				tentative {
+					[fnc.vfs_lookup_internal] /* lookup parent of new path */ ;
+					tentative {
+						[fnc.vfs_lookup_internal] /* destroy old link for the new path */ ;
+						tentative {
+							[fnc.vfs_lookup_internal] /* create new link for the new path */ ;
+							tentative {
+								[fnc.vfs_lookup_internal] /* destroy link for the old path */
+							}
+						}
+					}
+				}
+			}
+		}
+	} +
+	
+	?sync {
+		tentative {
+			!fs.sync
+		}
+	} +
+	
+	?seek
+	
+)* ;
+?ipc_m_phne_hungup
Index: contrib/highlight/adl.syntax
===================================================================
--- contrib/highlight/adl.syntax	(revision ec8bab59255734063dbf86e43ca51eeeb9ff58e8)
+++ contrib/highlight/adl.syntax	(revision 1993f9a68ff3c23290d79db8b57db81b201848c4)
@@ -18,8 +18,12 @@
 	
 	keyword whole ipcarg_t yellow
+	keyword whole string yellow
+	keyword whole stream yellow
 	keyword whole void yellow
 	
 	keyword whole in yellow
+	keyword whole in_copy yellow
 	keyword whole out yellow
+	keyword whole out_copy yellow
 	
 	keyword whole protocol yellow
