Skip to content

Commit a6ef0de

Browse files
committed
[libc][NFC] Rename RPC opcodes to better reflect their usage
Summary: RPC_ is a generic prefix here, use LIBC_ to indicate that these are opcodes used to implement the C library
1 parent 4226e0a commit a6ef0de

File tree

26 files changed

+110
-110
lines changed

26 files changed

+110
-110
lines changed

libc/shared/rpc_opcodes.h

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -15,37 +15,37 @@
1515
#define LLVM_LIBC_OPCODE(n) (LLVM_LIBC_RPC_BASE << 24 | n)
1616

1717
typedef enum {
18-
RPC_NOOP = LLVM_LIBC_OPCODE(0),
19-
RPC_EXIT = LLVM_LIBC_OPCODE(1),
20-
RPC_WRITE_TO_STDOUT = LLVM_LIBC_OPCODE(2),
21-
RPC_WRITE_TO_STDERR = LLVM_LIBC_OPCODE(3),
22-
RPC_WRITE_TO_STREAM = LLVM_LIBC_OPCODE(4),
23-
RPC_WRITE_TO_STDOUT_NEWLINE = LLVM_LIBC_OPCODE(5),
24-
RPC_READ_FROM_STREAM = LLVM_LIBC_OPCODE(6),
25-
RPC_READ_FGETS = LLVM_LIBC_OPCODE(7),
26-
RPC_OPEN_FILE = LLVM_LIBC_OPCODE(8),
27-
RPC_CLOSE_FILE = LLVM_LIBC_OPCODE(9),
28-
RPC_MALLOC = LLVM_LIBC_OPCODE(10),
29-
RPC_FREE = LLVM_LIBC_OPCODE(11),
30-
RPC_HOST_CALL = LLVM_LIBC_OPCODE(12),
31-
RPC_ABORT = LLVM_LIBC_OPCODE(13),
32-
RPC_FEOF = LLVM_LIBC_OPCODE(14),
33-
RPC_FERROR = LLVM_LIBC_OPCODE(15),
34-
RPC_CLEARERR = LLVM_LIBC_OPCODE(16),
35-
RPC_FSEEK = LLVM_LIBC_OPCODE(17),
36-
RPC_FTELL = LLVM_LIBC_OPCODE(18),
37-
RPC_FFLUSH = LLVM_LIBC_OPCODE(19),
38-
RPC_UNGETC = LLVM_LIBC_OPCODE(20),
39-
RPC_PRINTF_TO_STDOUT = LLVM_LIBC_OPCODE(21),
40-
RPC_PRINTF_TO_STDERR = LLVM_LIBC_OPCODE(22),
41-
RPC_PRINTF_TO_STREAM = LLVM_LIBC_OPCODE(23),
42-
RPC_PRINTF_TO_STDOUT_PACKED = LLVM_LIBC_OPCODE(24),
43-
RPC_PRINTF_TO_STDERR_PACKED = LLVM_LIBC_OPCODE(25),
44-
RPC_PRINTF_TO_STREAM_PACKED = LLVM_LIBC_OPCODE(26),
45-
RPC_REMOVE = LLVM_LIBC_OPCODE(27),
46-
RPC_RENAME = LLVM_LIBC_OPCODE(28),
47-
RPC_SYSTEM = LLVM_LIBC_OPCODE(29),
48-
RPC_LAST = 0xFFFFFFFF,
18+
LIBC_NOOP = LLVM_LIBC_OPCODE(0),
19+
LIBC_EXIT = LLVM_LIBC_OPCODE(1),
20+
LIBC_WRITE_TO_STDOUT = LLVM_LIBC_OPCODE(2),
21+
LIBC_WRITE_TO_STDERR = LLVM_LIBC_OPCODE(3),
22+
LIBC_WRITE_TO_STREAM = LLVM_LIBC_OPCODE(4),
23+
LIBC_WRITE_TO_STDOUT_NEWLINE = LLVM_LIBC_OPCODE(5),
24+
LIBC_READ_FROM_STREAM = LLVM_LIBC_OPCODE(6),
25+
LIBC_READ_FGETS = LLVM_LIBC_OPCODE(7),
26+
LIBC_OPEN_FILE = LLVM_LIBC_OPCODE(8),
27+
LIBC_CLOSE_FILE = LLVM_LIBC_OPCODE(9),
28+
LIBC_MALLOC = LLVM_LIBC_OPCODE(10),
29+
LIBC_FREE = LLVM_LIBC_OPCODE(11),
30+
LIBC_HOST_CALL = LLVM_LIBC_OPCODE(12),
31+
LIBC_ABORT = LLVM_LIBC_OPCODE(13),
32+
LIBC_FEOF = LLVM_LIBC_OPCODE(14),
33+
LIBC_FERROR = LLVM_LIBC_OPCODE(15),
34+
LIBC_CLEARERR = LLVM_LIBC_OPCODE(16),
35+
LIBC_FSEEK = LLVM_LIBC_OPCODE(17),
36+
LIBC_FTELL = LLVM_LIBC_OPCODE(18),
37+
LIBC_FFLUSH = LLVM_LIBC_OPCODE(19),
38+
LIBC_UNGETC = LLVM_LIBC_OPCODE(20),
39+
LIBC_PRINTF_TO_STDOUT = LLVM_LIBC_OPCODE(21),
40+
LIBC_PRINTF_TO_STDERR = LLVM_LIBC_OPCODE(22),
41+
LIBC_PRINTF_TO_STREAM = LLVM_LIBC_OPCODE(23),
42+
LIBC_PRINTF_TO_STDOUT_PACKED = LLVM_LIBC_OPCODE(24),
43+
LIBC_PRINTF_TO_STDERR_PACKED = LLVM_LIBC_OPCODE(25),
44+
LIBC_PRINTF_TO_STREAM_PACKED = LLVM_LIBC_OPCODE(26),
45+
LIBC_REMOVE = LLVM_LIBC_OPCODE(27),
46+
LIBC_RENAME = LLVM_LIBC_OPCODE(28),
47+
LIBC_SYSTEM = LLVM_LIBC_OPCODE(29),
48+
LIBC_LAST = 0xFFFFFFFF,
4949
} rpc_opcode_t;
5050

5151
#undef LLVM_LIBC_OPCODE

libc/src/__support/GPU/allocator.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ namespace {
1717

1818
void *rpc_allocate(uint64_t size) {
1919
void *ptr = nullptr;
20-
rpc::Client::Port port = rpc::client.open<RPC_MALLOC>();
20+
rpc::Client::Port port = rpc::client.open<LIBC_MALLOC>();
2121
port.send_and_recv(
2222
[=](rpc::Buffer *buffer, uint32_t) { buffer->data[0] = size; },
2323
[&](rpc::Buffer *buffer, uint32_t) {
@@ -28,7 +28,7 @@ void *rpc_allocate(uint64_t size) {
2828
}
2929

3030
void rpc_free(void *ptr) {
31-
rpc::Client::Port port = rpc::client.open<RPC_FREE>();
31+
rpc::Client::Port port = rpc::client.open<LIBC_FREE>();
3232
port.send([=](rpc::Buffer *buffer, uint32_t) {
3333
buffer->data[0] = reinterpret_cast<uintptr_t>(ptr);
3434
});

libc/src/__support/OSUtil/gpu/exit.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ namespace internal {
1818

1919
[[noreturn]] void exit(int status) {
2020
// We want to first make sure the server is listening before we exit.
21-
rpc::Client::Port port = rpc::client.open<RPC_EXIT>();
21+
rpc::Client::Port port = rpc::client.open<LIBC_EXIT>();
2222
port.send_and_recv([](rpc::Buffer *, uint32_t) {},
2323
[](rpc::Buffer *, uint32_t) {});
2424
port.send([&](rpc::Buffer *buffer, uint32_t) {

libc/src/__support/OSUtil/gpu/io.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
namespace LIBC_NAMESPACE_DECL {
1616

1717
void write_to_stderr(cpp::string_view msg) {
18-
rpc::Client::Port port = rpc::client.open<RPC_WRITE_TO_STDERR>();
18+
rpc::Client::Port port = rpc::client.open<LIBC_WRITE_TO_STDERR>();
1919
port.send_n(msg.data(), msg.size());
2020
port.recv([](rpc::Buffer *, uint32_t) { /* void */ });
2121
port.close();

libc/src/gpu/rpc_host_call.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ namespace LIBC_NAMESPACE_DECL {
1919
// arguments. We expect that the pointer here is a valid pointer on the server.
2020
LLVM_LIBC_FUNCTION(unsigned long long, rpc_host_call,
2121
(void *fn, void *data, size_t size)) {
22-
rpc::Client::Port port = rpc::client.open<RPC_HOST_CALL>();
22+
rpc::Client::Port port = rpc::client.open<LIBC_HOST_CALL>();
2323
port.send_n(data, size);
2424
port.send([=](rpc::Buffer *buffer, uint32_t) {
2525
buffer->data[0] = reinterpret_cast<uintptr_t>(fn);

libc/src/stdio/gpu/clearerr.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
namespace LIBC_NAMESPACE_DECL {
1616

1717
LLVM_LIBC_FUNCTION(void, clearerr, (::FILE * stream)) {
18-
rpc::Client::Port port = rpc::client.open<RPC_CLEARERR>();
18+
rpc::Client::Port port = rpc::client.open<LIBC_CLEARERR>();
1919
port.send_and_recv(
2020
[=](rpc::Buffer *buffer, uint32_t) {
2121
buffer->data[0] = file::from_stream(stream);

libc/src/stdio/gpu/fclose.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ namespace LIBC_NAMESPACE_DECL {
1818
LLVM_LIBC_FUNCTION(int, fclose, (::FILE * stream)) {
1919
uint64_t ret = 0;
2020
uintptr_t file = reinterpret_cast<uintptr_t>(stream);
21-
rpc::Client::Port port = rpc::client.open<RPC_CLOSE_FILE>();
21+
rpc::Client::Port port = rpc::client.open<LIBC_CLOSE_FILE>();
2222
port.send_and_recv(
2323
[=](rpc::Buffer *buffer, uint32_t) { buffer->data[0] = file; },
2424
[&](rpc::Buffer *buffer, uint32_t) { ret = buffer->data[0]; });

libc/src/stdio/gpu/feof.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ namespace LIBC_NAMESPACE_DECL {
1616

1717
LLVM_LIBC_FUNCTION(int, feof, (::FILE * stream)) {
1818
int ret;
19-
rpc::Client::Port port = rpc::client.open<RPC_FEOF>();
19+
rpc::Client::Port port = rpc::client.open<LIBC_FEOF>();
2020
port.send_and_recv(
2121
[=](rpc::Buffer *buffer, uint32_t) {
2222
buffer->data[0] = file::from_stream(stream);

libc/src/stdio/gpu/ferror.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ namespace LIBC_NAMESPACE_DECL {
1616

1717
LLVM_LIBC_FUNCTION(int, ferror, (::FILE * stream)) {
1818
int ret;
19-
rpc::Client::Port port = rpc::client.open<RPC_FERROR>();
19+
rpc::Client::Port port = rpc::client.open<LIBC_FERROR>();
2020
port.send_and_recv(
2121
[=](rpc::Buffer *buffer, uint32_t) {
2222
buffer->data[0] = file::from_stream(stream);

libc/src/stdio/gpu/fflush.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ namespace LIBC_NAMESPACE_DECL {
1616

1717
LLVM_LIBC_FUNCTION(int, fflush, (::FILE * stream)) {
1818
int ret;
19-
rpc::Client::Port port = rpc::client.open<RPC_FFLUSH>();
19+
rpc::Client::Port port = rpc::client.open<LIBC_FFLUSH>();
2020
port.send_and_recv(
2121
[=](rpc::Buffer *buffer, uint32_t) {
2222
buffer->data[0] = file::from_stream(stream);

libc/src/stdio/gpu/fgets.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ LLVM_LIBC_FUNCTION(char *, fgets,
2626

2727
uint64_t recv_size;
2828
void *buf = nullptr;
29-
rpc::Client::Port port = rpc::client.open<RPC_READ_FGETS>();
29+
rpc::Client::Port port = rpc::client.open<LIBC_READ_FGETS>();
3030
port.send([=](rpc::Buffer *buffer, uint32_t) {
3131
buffer->data[0] = count;
3232
buffer->data[1] = file::from_stream(stream);

libc/src/stdio/gpu/file.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ LIBC_INLINE uint64_t write_impl(::FILE *file, const void *data, size_t size) {
5454
uint64_t ret = 0;
5555
rpc::Client::Port port = rpc::client.open<opcode>();
5656

57-
if constexpr (opcode == RPC_WRITE_TO_STREAM) {
57+
if constexpr (opcode == LIBC_WRITE_TO_STREAM) {
5858
port.send([&](rpc::Buffer *buffer, uint32_t) {
5959
buffer->data[0] = reinterpret_cast<uintptr_t>(file);
6060
});
@@ -70,17 +70,17 @@ LIBC_INLINE uint64_t write_impl(::FILE *file, const void *data, size_t size) {
7070

7171
LIBC_INLINE uint64_t write(::FILE *f, const void *data, size_t size) {
7272
if (f == stdout)
73-
return write_impl<RPC_WRITE_TO_STDOUT>(f, data, size);
73+
return write_impl<LIBC_WRITE_TO_STDOUT>(f, data, size);
7474
else if (f == stderr)
75-
return write_impl<RPC_WRITE_TO_STDERR>(f, data, size);
75+
return write_impl<LIBC_WRITE_TO_STDERR>(f, data, size);
7676
else
77-
return write_impl<RPC_WRITE_TO_STREAM>(f, data, size);
77+
return write_impl<LIBC_WRITE_TO_STREAM>(f, data, size);
7878
}
7979

8080
LIBC_INLINE uint64_t read_from_stream(::FILE *file, void *buf, size_t size) {
8181
uint64_t ret = 0;
8282
uint64_t recv_size;
83-
rpc::Client::Port port = rpc::client.open<RPC_READ_FROM_STREAM>();
83+
rpc::Client::Port port = rpc::client.open<LIBC_READ_FROM_STREAM>();
8484
port.send([=](rpc::Buffer *buffer, uint32_t) {
8585
buffer->data[0] = size;
8686
buffer->data[1] = from_stream(file);

libc/src/stdio/gpu/fopen.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ namespace LIBC_NAMESPACE_DECL {
1818
LLVM_LIBC_FUNCTION(::FILE *, fopen,
1919
(const char *__restrict path, const char *__restrict mode)) {
2020
uintptr_t file;
21-
rpc::Client::Port port = rpc::client.open<RPC_OPEN_FILE>();
21+
rpc::Client::Port port = rpc::client.open<LIBC_OPEN_FILE>();
2222
port.send_n(path, internal::string_length(path) + 1);
2323
port.send_and_recv(
2424
[=](rpc::Buffer *buffer, uint32_t) {

libc/src/stdio/gpu/fseek.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ namespace LIBC_NAMESPACE_DECL {
1616

1717
LLVM_LIBC_FUNCTION(int, fseek, (::FILE * stream, long offset, int whence)) {
1818
int ret;
19-
rpc::Client::Port port = rpc::client.open<RPC_FSEEK>();
19+
rpc::Client::Port port = rpc::client.open<LIBC_FSEEK>();
2020
port.send_and_recv(
2121
[=](rpc::Buffer *buffer, uint32_t) {
2222
buffer->data[0] = file::from_stream(stream);

libc/src/stdio/gpu/ftell.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ namespace LIBC_NAMESPACE_DECL {
1616

1717
LLVM_LIBC_FUNCTION(long, ftell, (::FILE * stream)) {
1818
long ret;
19-
rpc::Client::Port port = rpc::client.open<RPC_FSEEK>();
19+
rpc::Client::Port port = rpc::client.open<LIBC_FSEEK>();
2020
port.send_and_recv(
2121
[=](rpc::Buffer *buffer, uint32_t) {
2222
buffer->data[0] = file::from_stream(stream);

libc/src/stdio/gpu/puts.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ namespace LIBC_NAMESPACE_DECL {
1818

1919
LLVM_LIBC_FUNCTION(int, puts, (const char *__restrict str)) {
2020
cpp::string_view str_view(str);
21-
auto written = file::write_impl<RPC_WRITE_TO_STDOUT_NEWLINE>(stdout, str,
21+
auto written = file::write_impl<LIBC_WRITE_TO_STDOUT_NEWLINE>(stdout, str,
2222
str_view.size());
2323
if (written != str_view.size() + 1)
2424
return EOF;

libc/src/stdio/gpu/remove.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ namespace LIBC_NAMESPACE_DECL {
1616

1717
LLVM_LIBC_FUNCTION(int, remove, (const char *path)) {
1818
int ret;
19-
rpc::Client::Port port = rpc::client.open<RPC_REMOVE>();
19+
rpc::Client::Port port = rpc::client.open<LIBC_REMOVE>();
2020
port.send_n(path, internal::string_length(path) + 1);
2121
port.recv([&](rpc::Buffer *buffer, uint32_t) {
2222
ret = static_cast<int>(buffer->data[0]);

libc/src/stdio/gpu/rename.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ namespace LIBC_NAMESPACE_DECL {
1717

1818
LLVM_LIBC_FUNCTION(int, rename, (const char *oldpath, const char *newpath)) {
1919
int ret;
20-
rpc::Client::Port port = rpc::client.open<RPC_RENAME>();
20+
rpc::Client::Port port = rpc::client.open<LIBC_RENAME>();
2121
port.send_n(oldpath, internal::string_length(oldpath) + 1);
2222
port.send_n(newpath, internal::string_length(newpath) + 1);
2323
port.recv([&](rpc::Buffer *buffer, uint32_t) {

libc/src/stdio/gpu/ungetc.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ namespace LIBC_NAMESPACE_DECL {
1616

1717
LLVM_LIBC_FUNCTION(int, ungetc, (int c, ::FILE *stream)) {
1818
int ret;
19-
rpc::Client::Port port = rpc::client.open<RPC_UNGETC>();
19+
rpc::Client::Port port = rpc::client.open<LIBC_UNGETC>();
2020
port.send_and_recv(
2121
[=](rpc::Buffer *buffer, uint32_t) {
2222
buffer->data[0] = c;

libc/src/stdio/gpu/vfprintf_utils.h

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@ LIBC_INLINE int vfprintf_impl(::FILE *__restrict file,
2323
uint64_t mask = gpu::get_lane_mask();
2424
rpc::Client::Port port = rpc::client.open<opcode>();
2525

26-
if constexpr (opcode == RPC_PRINTF_TO_STREAM ||
27-
opcode == RPC_PRINTF_TO_STREAM_PACKED) {
26+
if constexpr (opcode == LIBC_PRINTF_TO_STREAM ||
27+
opcode == LIBC_PRINTF_TO_STREAM_PACKED) {
2828
port.send([&](rpc::Buffer *buffer, uint32_t) {
2929
buffer->data[0] = reinterpret_cast<uintptr_t>(file);
3030
});
@@ -63,24 +63,24 @@ LIBC_INLINE int vfprintf_internal(::FILE *__restrict stream,
6363
// separate opcode so the server knows how much to advance the pointers.
6464
#if defined(LIBC_TARGET_ARCH_IS_AMDGPU)
6565
if (stream == stdout)
66-
return vfprintf_impl<RPC_PRINTF_TO_STDOUT_PACKED>(stream, format,
67-
format_size, vlist);
66+
return vfprintf_impl<LIBC_PRINTF_TO_STDOUT_PACKED>(stream, format,
67+
format_size, vlist);
6868
else if (stream == stderr)
69-
return vfprintf_impl<RPC_PRINTF_TO_STDERR_PACKED>(stream, format,
70-
format_size, vlist);
69+
return vfprintf_impl<LIBC_PRINTF_TO_STDERR_PACKED>(stream, format,
70+
format_size, vlist);
7171
else
72-
return vfprintf_impl<RPC_PRINTF_TO_STREAM_PACKED>(stream, format,
73-
format_size, vlist);
72+
return vfprintf_impl<LIBC_PRINTF_TO_STREAM_PACKED>(stream, format,
73+
format_size, vlist);
7474
#else
7575
if (stream == stdout)
76-
return vfprintf_impl<RPC_PRINTF_TO_STDOUT>(stream, format, format_size,
77-
vlist);
76+
return vfprintf_impl<LIBC_PRINTF_TO_STDOUT>(stream, format, format_size,
77+
vlist);
7878
else if (stream == stderr)
79-
return vfprintf_impl<RPC_PRINTF_TO_STDERR>(stream, format, format_size,
80-
vlist);
79+
return vfprintf_impl<LIBC_PRINTF_TO_STDERR>(stream, format, format_size,
80+
vlist);
8181
else
82-
return vfprintf_impl<RPC_PRINTF_TO_STREAM>(stream, format, format_size,
83-
vlist);
82+
return vfprintf_impl<LIBC_PRINTF_TO_STREAM>(stream, format, format_size,
83+
vlist);
8484
#endif
8585
}
8686

libc/src/stdlib/gpu/abort.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ namespace LIBC_NAMESPACE_DECL {
1717

1818
LLVM_LIBC_FUNCTION(void, abort, ()) {
1919
// We want to first make sure the server is listening before we abort.
20-
rpc::Client::Port port = rpc::client.open<RPC_ABORT>();
20+
rpc::Client::Port port = rpc::client.open<LIBC_ABORT>();
2121
port.send_and_recv([](rpc::Buffer *, uint32_t) {},
2222
[](rpc::Buffer *, uint32_t) {});
2323
port.send([&](rpc::Buffer *, uint32_t) {});

libc/src/stdlib/gpu/system.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ namespace LIBC_NAMESPACE_DECL {
1717

1818
LLVM_LIBC_FUNCTION(int, system, (const char *command)) {
1919
int ret;
20-
rpc::Client::Port port = rpc::client.open<RPC_SYSTEM>();
20+
rpc::Client::Port port = rpc::client.open<LIBC_SYSTEM>();
2121
port.send_n(command, internal::string_length(command) + 1);
2222
port.recv([&](rpc::Buffer *buffer, uint32_t) {
2323
ret = static_cast<int>(buffer->data[0]);

libc/test/integration/startup/gpu/rpc_test.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ static void test_add_simple() {
3535
// Test to ensure that the RPC mechanism doesn't hang on divergence.
3636
static void test_noop(uint8_t data) {
3737
LIBC_NAMESPACE::rpc::Client::Port port =
38-
LIBC_NAMESPACE::rpc::client.open<RPC_NOOP>();
38+
LIBC_NAMESPACE::rpc::client.open<LIBC_NOOP>();
3939
port.send([=](LIBC_NAMESPACE::rpc::Buffer *buffer, uint32_t) {
4040
buffer->data[0] = data;
4141
});

libc/utils/gpu/loader/Loader.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,13 +168,13 @@ inline uint32_t handle_server(rpc::Server &server, uint32_t index,
168168
port->recv([&](rpc::Buffer *, uint32_t) {});
169169
break;
170170
}
171-
case RPC_MALLOC: {
171+
case LIBC_MALLOC: {
172172
port->recv_and_send([&](rpc::Buffer *buffer, uint32_t) {
173173
buffer->data[0] = reinterpret_cast<uintptr_t>(alloc(buffer->data[0]));
174174
});
175175
break;
176176
}
177-
case RPC_FREE: {
177+
case LIBC_FREE: {
178178
port->recv([&](rpc::Buffer *buffer, uint32_t) {
179179
free(reinterpret_cast<void *>(buffer->data[0]));
180180
});

0 commit comments

Comments
 (0)