Skip to content
This repository has been archived by the owner on May 22, 2023. It is now read-only.

Commit

Permalink
Add clarifications, fix indentation
Browse files Browse the repository at this point in the history
ref #173
  • Loading branch information
jklmnn committed May 20, 2020
1 parent b56cdb1 commit 9e2394d
Show file tree
Hide file tree
Showing 10 changed files with 30 additions and 18 deletions.
12 changes: 6 additions & 6 deletions src/core/linux/gneiss-broker-main.adb
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,14 @@ is
Gneiss_Internal.Syscall.Waitpid (B_State.Components (Index).Pid, Exit_Status);
if Result = SXML.Result_OK then
Gneiss_Internal.Print.Info ("Component "
& XML_Buf (XML_Buf'First .. Last)
& " exited with status "
& Basalt.Strings.Image (Exit_Status));
& XML_Buf (XML_Buf'First .. Last)
& " exited with status "
& Basalt.Strings.Image (Exit_Status));
else
Gneiss_Internal.Print.Info ("Component PID "
& Basalt.Strings.Image (B_State.Components (Index).Pid)
& " exited with status "
& Basalt.Strings.Image (Exit_Status));
& Basalt.Strings.Image (B_State.Components (Index).Pid)
& " exited with status "
& Basalt.Strings.Image (Exit_Status));
end if;
if Gneiss_Internal.Valid (B_State.Components (Index).Fd) then
Gneiss_Internal.Epoll.Remove (B_State.Epoll_Fd, B_State.Components (Index).Fd, Ignore_Success);
Expand Down
2 changes: 1 addition & 1 deletion src/core/linux/gneiss-broker-startup.adb
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ is
pragma Warnings (On, "unused assignment to ""Fd""");
Parent := True;
Gneiss_Internal.Print.Info ("Started " & XML_Buf (XML_Buf'First .. Last)
& " with PID " & Basalt.Strings.Image (Pid));
& " with PID " & Basalt.Strings.Image (Pid));
else -- Pid = 0, Child
Gneiss_Internal.Syscall.Close (State.Epoll_Fd);
Load (State, Fd, Query, Status);
Expand Down
2 changes: 1 addition & 1 deletion src/log/genode/gneiss-log.adb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ is
function Index (Session : Dispatcher_Session) return Session_Index_Option is
(Session.Index);

function Registered (Session : Dispatcher_Session) return Boolean is (True);
function Registered (Session : Dispatcher_Session) return Boolean is (False);

end Gneiss.Log;
4 changes: 4 additions & 0 deletions src/log/server/linux/gneiss-log-dispatcher.adb
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ is
Label.Value (Label.Value'First .. Label.Last));
end if;
else
-- If Fd /= Dispatch_Fd a server session has been closed by a client. So
-- Dispatch will be called with an invalid capability that carries the
-- file descriptor as Clean_Fd which is then used to clean up the disconnected
-- session in Session_Cleanup.
Dispatch (Session,
Dispatcher_Capability'(Client_Fd => -1,
Server_Fd => -1,
Expand Down
2 changes: 1 addition & 1 deletion src/memory/genode/gneiss-memory.adb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ is
function Index (Session : Dispatcher_Session) return Session_Index_Option is
(Session.Index);

function Registered (Session : Dispatcher_Session) return Boolean is (True);
function Registered (Session : Dispatcher_Session) return Boolean is (False);

end Gneiss.Memory;
4 changes: 4 additions & 0 deletions src/memory/server/linux/gneiss-memory-dispatcher.adb
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ is
Label.Value (Label.Value'First .. Label.Last));
end if;
else
-- If Fd /= Dispatch_Fd a server session has been closed by a client. So
-- Dispatch will be called with an invalid capability that carries the
-- file descriptor as Clean_Fd which is then used to clean up the disconnected
-- session in Session_Cleanup.
Dispatch (Session,
Dispatcher_Capability'(Memfd => -1,
Client_Fd => -1,
Expand Down
2 changes: 1 addition & 1 deletion src/message/genode/gneiss-message.adb
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@ is
function Index (Session : Dispatcher_Session) return Session_Index_Option is
(Session.Index);

function Registered (Session : Dispatcher_Session) return Boolean is (True);
function Registered (Session : Dispatcher_Session) return Boolean is (False);

end Gneiss.Message;
4 changes: 4 additions & 0 deletions src/message/server/linux/gneiss-message-dispatcher.adb
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@ is
Label.Value (Label.Value'First .. Label.Last));
end if;
else
-- If Fd /= Dispatch_Fd a server session has been closed by a client. So
-- Dispatch will be called with an invalid capability that carries the
-- file descriptor as Clean_Fd which is then used to clean up the disconnected
-- session in Session_Cleanup.
Dispatch (Session,
Dispatcher_Capability'(Client_Fd => -1,
Server_Fd => -1,
Expand Down
2 changes: 1 addition & 1 deletion test/log_proxy/component.adb
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,8 @@ is
Flush (S);
else
declare
-- WORKAROUND: Componolit/Workarounds#25
Clr : constant String := Get_Color (S.Hue);
-- Separate declaration: non-scalar object declared before loop-invariant is not yet supported
begin
for H of Clr loop
pragma Loop_Invariant (Log.Initialized (Client));
Expand Down
14 changes: 7 additions & 7 deletions test/message_client/component.adb
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ is
Gneiss_Internal.Platform_State,
Main.Platform));

function Null_Terminate (S : String) return String with
Post => Null_Terminate'Result'First = S'First
and then Null_Terminate'Result'Length <= S'Length,
function Strip (S : String) return String with
Post => Strip'Result'First = S'First
and then Strip'Result'Length <= S'Length,
Global => null;

package Message is new Gneiss.Message (Message_Buffer, Null_Buffer);
Expand All @@ -35,7 +35,7 @@ is
Log : Gneiss_Log.Client_Session;
Capability : Gneiss.Capability;

function Null_Terminate (S : String) return String
function Strip (S : String) return String
is
begin
for I in S'Range loop
Expand All @@ -44,7 +44,7 @@ is
end if;
end loop;
return S;
end Null_Terminate;
end Strip;

procedure Construct (Cap : Gneiss.Capability)
is
Expand All @@ -55,7 +55,7 @@ is
Message_Client.Initialize (Client, Capability, "log");
if Gneiss_Log.Initialized (Log) and Message.Initialized (Client) then
Msg (Msg'First .. Msg'First + 11) := "Hello World!";
Log_Client.Info (Log, "Sending: " & Null_Terminate (Msg));
Log_Client.Info (Log, "Sending: " & Strip (Msg));
Message_Client.Write (Client, Msg);
else
Main.Vacate (Capability, Main.Failure);
Expand All @@ -71,7 +71,7 @@ is
pragma Loop_Invariant (Gneiss_Log.Initialized (Log));
pragma Loop_Invariant (Message.Initialized (Client));
Message_Client.Read (Client, Msg);
Log_Client.Info (Log, "Received: " & Null_Terminate (Msg));
Log_Client.Info (Log, "Received: " & Strip (Msg));
Main.Vacate (Capability, Main.Success);
end loop;
end if;
Expand Down

0 comments on commit 9e2394d

Please sign in to comment.