osmocom-bb[master]: WIP: First invocation of a primitive and callback into lua..

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

Holger Freyther gerrit-no-reply at lists.osmocom.org
Fri Nov 10 10:57:16 UTC 2017


Patch Set 1:

(5 comments)

https://gerrit.osmocom.org/#/c/4772/1/src/host/layer23/src/mobile/script_lua.c
File src/host/layer23/src/mobile/script_lua.c:

Line 99: 	struct timer_userdata *timer = (void *)(intptr_t) prim->timer_id;
Don't we have a macro for ptr/int conversion?


Line 114: 		lua_error(L);
I think this is using a "longjmp" same for luaL_argcheck...


Line 127: 	lua_setmetatable(L, -2);
In LUA one manipulates the stack and 1 <= abs(index) <= top-of-stack is a valid range. One can use negative or positive numbers.

stack pos #1.. the first push to the stack (e.g. bottom)
stack pos #-1 the top of stack (last push)


Line 143: 	printf("GC...\n");
Need to cancel the timer here. There is no PRIM_OP_CANCEL. Should there be? Otherwise I do PRIM_MOB_TIMER_CANCEL primitive and no indication..


Line 147: static const struct luaL_Reg timer_funcs[] = {
these are the instance methods of the timer object. SO far only GC.. but we can add cancel later..


-- 
To view, visit https://gerrit.osmocom.org/4772
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I55603f71a1d2426622e3b601d2686903cb74a8e1
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Owner: Holger Freyther <holger at freyther.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Holger Freyther <holger at freyther.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr <nhofmeyr at sysmocom.de>
Gerrit-HasComments: Yes



More information about the gerrit-log mailing list