00001
00002
00003
00004
00005
00006
00007
00008 #include "local.h"
00009 #include <stdlib.h>
00010 #include <l4/env/errno.h>
00011
00012 void *l4ore_get_send_area(int handle)
00013 {
00014 return descriptor_table[handle].send_addr;
00015 }
00016
00017
00018
00019 int ore_send_dsi(l4ore_handle_t channel, int handle,
00020 char *data, unsigned int size)
00021 {
00022 dsi_packet_t *packet;
00023 dsi_socket_t *socket = descriptor_table[handle].local_send_socket;
00024 int ret;
00025
00026 ret = dsi_packet_get(socket, &packet);
00027 if (ret)
00028 {
00029 LOG_Error("error on packet_get: %d", ret);
00030 LOG("%s", l4env_strerror(-ret));
00031 return -1;
00032 }
00033
00034 ret = dsi_packet_add_data(socket, packet, data, size, 0);
00035 if (ret)
00036 {
00037 LOG_Error("error on add_data: %d", ret);
00038 LOG("%s", l4env_strerror(-ret));
00039 return -1;
00040 }
00041
00042 ret = dsi_packet_commit(socket, packet);
00043 if (ret)
00044 {
00045 LOG_Error("error on packet_commit: %d", ret);
00046 LOG("%s", l4env_strerror(-ret));
00047 return -1;
00048 }
00049
00050 return 0;
00051 }