logchannel.c
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #include <l4/sys/types.h>
00015 #include "log_comm.h"
00016 #include "internal.h"
00017 #include <l4/log/l4log.h>
00018 #include <l4/log/server.h>
00019 #include <l4/env/errno.h>
00020 #include "log-client.h"
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035 int LOG_channel_open(int channel, l4_fpage_t page)
00036 {
00037 int ret;
00038 l4_snd_fpage_t f;
00039 CORBA_Environment env = dice_default_environment;
00040
00041 if (page.fp.size > LOG_LOG2_CHANNEL_BUFFER_SIZE)
00042 return -L4_ENOMEM;
00043 if (check_server())
00044 return -L4_ENOTFOUND;
00045
00046 f.snd_base = 0;
00047 f.fpage = page;
00048 ret = log_channel_open_call (&log_server, f, channel, &env);
00049 if (DICE_HAS_EXCEPTION(&env))
00050 return -DICE_IPC_ERROR(&env);
00051
00052 return ret;
00053 }
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068 int LOG_channel_write(int id, unsigned off, unsigned size)
00069 {
00070 int ret;
00071 CORBA_Environment env = dice_default_environment;
00072
00073 if (!initialized)
00074 return -L4_EIPC;
00075
00076 ret = log_channel_write_call (&log_server, id, off, size, &env);
00077 if (DICE_HAS_EXCEPTION(&env))
00078 return -DICE_IPC_ERROR(&env);
00079
00080 return ret;
00081 }
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092 int LOG_channel_flush(int id)
00093 {
00094 int ret;
00095 CORBA_Environment env = dice_default_environment;
00096
00097 if (!initialized)
00098 return -L4_EIPC;
00099
00100 ret = log_channel_flush_call (&log_server, id, &env);
00101 if (DICE_HAS_EXCEPTION(&env))
00102 return -DICE_IPC_ERROR(&env);
00103
00104 return ret;
00105 }
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116 int LOG_channel_close(int id)
00117 {
00118 int ret;
00119 CORBA_Environment env = dice_default_environment;
00120
00121 if (!initialized)
00122 return -L4_EIPC;
00123
00124 ret = log_channel_close_call (&log_server, id, &env);
00125 if (DICE_HAS_EXCEPTION(&env))
00126 return -DICE_IPC_ERROR(&env);
00127
00128 return ret;
00129 }