Skip to content

Commit 153592f

Browse files
author
whitequark
committedAug 8, 2015
Naming.
1 parent b26af5d commit 153592f

File tree

5 files changed

+17
-17
lines changed

5 files changed

+17
-17
lines changed
 

Diff for: ‎artiq/compiler/transforms/llvm_ir_generator.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ def llbuiltin(self, name):
153153
llty = ll.FunctionType(ll.VoidType(), [self.llty_of_type(builtins.TException())])
154154
elif name == "__artiq_reraise":
155155
llty = ll.FunctionType(ll.VoidType(), [])
156-
elif name == "rpc":
156+
elif name == "send_rpc":
157157
llty = ll.FunctionType(ll.IntType(32), [ll.IntType(32), ll.IntType(8).as_pointer()],
158158
var_arg=True)
159159
else:
@@ -609,7 +609,7 @@ def _build_rpc(self, service, args, return_type):
609609
tag += self._rpc_tag(arg.type, arg.type, None)
610610
else:
611611
tag += self._rpc_tag(arg.type, arg.type, arg.loc)
612-
tag += b":\x00"
612+
tag += b"\x00"
613613
lltag = self.llconst_of_const(ir.Constant(tag, builtins.TStr()))
614614

615615
llargs = []
@@ -619,7 +619,7 @@ def _build_rpc(self, service, args, return_type):
619619
self.llbuilder.store(llarg, llargslot)
620620
llargs.append(llargslot)
621621

622-
return self.llbuiltin("rpc"), [llservice, lltag] + llargs
622+
return self.llbuiltin("send_rpc"), [llservice, lltag] + llargs
623623

624624
def prepare_call(self, insn):
625625
if types.is_rpc_function(insn.target_function().type):

Diff for: ‎soc/runtime/ksupport.c

+8-8
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ static const struct symbol runtime_exports[] = {
9292

9393
{"log", &log},
9494
{"lognonl", &lognonl},
95-
{"rpc", &rpc},
95+
{"send_rpc", &send_rpc},
9696

9797
/* direct syscalls */
9898
{"rtio_get_counter", &rtio_get_counter},
@@ -301,19 +301,19 @@ void watchdog_clear(int id)
301301
mailbox_send_and_wait(&request);
302302
}
303303

304-
int rpc(int service, const char *tag, ...)
304+
int send_rpc(int service, const char *tag, ...)
305305
{
306-
struct msg_rpc_send_request request;
307-
struct msg_base *reply;
306+
struct msg_rpc_send request;
308307

309-
request.type = MESSAGE_TYPE_RPC_SEND_REQUEST;
308+
request.type = MESSAGE_TYPE_RPC_SEND;
310309
request.service = service;
311310
request.tag = tag;
312311
va_start(request.args, tag);
313312
mailbox_send_and_wait(&request);
314313
va_end(request.args);
315314

316-
reply = mailbox_wait_and_receive();
315+
// struct msg_base *reply;
316+
// reply = mailbox_wait_and_receive();
317317
// if(reply->type == MESSAGE_TYPE_RPC_REPLY) {
318318
// int result = ((struct msg_rpc_reply *)reply)->result;
319319
// mailbox_acknowledge();
@@ -325,8 +325,8 @@ int rpc(int service, const char *tag, ...)
325325
// mailbox_acknowledge();
326326
// __artiq_raise(&exception);
327327
// } else {
328-
log("Malformed MESSAGE_TYPE_RPC_REQUEST reply type %d",
329-
reply->type);
328+
// log("Malformed MESSAGE_TYPE_RPC_REQUEST reply type %d",
329+
// reply->type);
330330
while(1);
331331
// }
332332
}

Diff for: ‎soc/runtime/ksupport.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ long long int now_init(void);
55
void now_save(long long int now);
66
int watchdog_set(int ms);
77
void watchdog_clear(int id);
8-
int rpc(int service, const char *tag, ...);
8+
int send_rpc(int service, const char *tag, ...);
99
void lognonl(const char *fmt, ...);
1010
void log(const char *fmt, ...);
1111

Diff for: ‎soc/runtime/messages.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ enum {
1414
MESSAGE_TYPE_WATCHDOG_SET_REQUEST,
1515
MESSAGE_TYPE_WATCHDOG_SET_REPLY,
1616
MESSAGE_TYPE_WATCHDOG_CLEAR,
17-
MESSAGE_TYPE_RPC_SEND_REQUEST,
17+
MESSAGE_TYPE_RPC_SEND,
1818
MESSAGE_TYPE_RPC_RECV_REQUEST,
1919
MESSAGE_TYPE_RPC_RECV_REPLY,
2020
MESSAGE_TYPE_RPC_EXCEPTION,
@@ -81,7 +81,7 @@ struct msg_watchdog_clear {
8181
int id;
8282
};
8383

84-
struct msg_rpc_send_request {
84+
struct msg_rpc_send {
8585
int type;
8686
int service;
8787
const char *tag;

Diff for: ‎soc/runtime/session.c

+3-3
Original file line numberDiff line numberDiff line change
@@ -650,7 +650,7 @@ static int send_rpc_request(int service, const char *tag, va_list args)
650650
out_packet_start(REMOTEMSG_TYPE_RPC_REQUEST);
651651
out_packet_int32(service);
652652

653-
while(*tag != ':') {
653+
while(*tag) {
654654
void *value = va_arg(args, void*);
655655
if(!kloader_validate_kpointer(value))
656656
return 0;
@@ -735,8 +735,8 @@ static int process_kmsg(struct msg_base *umsg)
735735
break;
736736
}
737737

738-
case MESSAGE_TYPE_RPC_SEND_REQUEST: {
739-
struct msg_rpc_send_request *msg = (struct msg_rpc_send_request *)umsg;
738+
case MESSAGE_TYPE_RPC_SEND: {
739+
struct msg_rpc_send *msg = (struct msg_rpc_send *)umsg;
740740

741741
if(!send_rpc_request(msg->service, msg->tag, msg->args)) {
742742
log("Failed to send RPC request");

0 commit comments

Comments
 (0)
Please sign in to comment.