Lines Matching refs:packet
70 static inline void lmkd_pack_get_target(LMKD_CTRL_PACKET packet, int target_idx, in lmkd_pack_get_target() argument
72 target->minfree = ntohl(packet[target_idx * 2 + 1]); in lmkd_pack_get_target()
73 target->oom_adj_score = ntohl(packet[target_idx * 2 + 2]); in lmkd_pack_get_target()
80 static inline size_t lmkd_pack_set_target(LMKD_CTRL_PACKET packet, struct lmk_target* targets, in lmkd_pack_set_target() argument
83 packet[idx++] = htonl(LMK_TARGET); in lmkd_pack_set_target()
85 packet[idx++] = htonl(targets->minfree); in lmkd_pack_set_target()
86 packet[idx++] = htonl(targets->oom_adj_score); in lmkd_pack_set_target()
113 static inline void lmkd_pack_get_procprio(LMKD_CTRL_PACKET packet, int field_count, in lmkd_pack_get_procprio() argument
115 params->pid = (pid_t)ntohl(packet[1]); in lmkd_pack_get_procprio()
116 params->uid = (uid_t)ntohl(packet[2]); in lmkd_pack_get_procprio()
117 params->oomadj = ntohl(packet[3]); in lmkd_pack_get_procprio()
119 params->ptype = field_count > 3 ? (enum proc_type)ntohl(packet[4]) : PROC_TYPE_APP; in lmkd_pack_get_procprio()
126 static inline size_t lmkd_pack_set_procprio(LMKD_CTRL_PACKET packet, struct lmk_procprio* params) { in lmkd_pack_set_procprio() argument
127 packet[0] = htonl(LMK_PROCPRIO); in lmkd_pack_set_procprio()
128 packet[1] = htonl(params->pid); in lmkd_pack_set_procprio()
129 packet[2] = htonl(params->uid); in lmkd_pack_set_procprio()
130 packet[3] = htonl(params->oomadj); in lmkd_pack_set_procprio()
131 packet[4] = htonl((int)params->ptype); in lmkd_pack_set_procprio()
144 static inline void lmkd_pack_get_procremove(LMKD_CTRL_PACKET packet, in lmkd_pack_get_procremove() argument
146 params->pid = (pid_t)ntohl(packet[1]); in lmkd_pack_get_procremove()
153 static inline size_t lmkd_pack_set_procremove(LMKD_CTRL_PACKET packet, in lmkd_pack_set_procremove() argument
155 packet[0] = htonl(LMK_PROCREMOVE); in lmkd_pack_set_procremove()
156 packet[1] = htonl(params->pid); in lmkd_pack_set_procremove()
164 static inline size_t lmkd_pack_set_procpurge(LMKD_CTRL_PACKET packet) { in lmkd_pack_set_procpurge() argument
165 packet[0] = htonl(LMK_PROCPURGE); in lmkd_pack_set_procpurge()
179 static inline void lmkd_pack_get_getkillcnt(LMKD_CTRL_PACKET packet, in lmkd_pack_get_getkillcnt() argument
181 params->min_oomadj = ntohl(packet[1]); in lmkd_pack_get_getkillcnt()
182 params->max_oomadj = ntohl(packet[2]); in lmkd_pack_get_getkillcnt()
189 static inline size_t lmkd_pack_set_getkillcnt(LMKD_CTRL_PACKET packet, in lmkd_pack_set_getkillcnt() argument
191 packet[0] = htonl(LMK_GETKILLCNT); in lmkd_pack_set_getkillcnt()
192 packet[1] = htonl(params->min_oomadj); in lmkd_pack_set_getkillcnt()
193 packet[2] = htonl(params->max_oomadj); in lmkd_pack_set_getkillcnt()
201 static inline size_t lmkd_pack_set_getkillcnt_repl(LMKD_CTRL_PACKET packet, int kill_cnt) { in lmkd_pack_set_getkillcnt_repl() argument
202 packet[0] = htonl(LMK_GETKILLCNT); in lmkd_pack_set_getkillcnt_repl()
203 packet[1] = htonl(kill_cnt); in lmkd_pack_set_getkillcnt_repl()
223 static inline void lmkd_pack_get_subscribe(LMKD_CTRL_PACKET packet, struct lmk_subscribe* params) { in lmkd_pack_get_subscribe() argument
224 params->evt_type = (enum async_event_type)ntohl(packet[1]); in lmkd_pack_get_subscribe()
231 static inline size_t lmkd_pack_set_subscribe(LMKD_CTRL_PACKET packet, enum async_event_type evt_typ… in lmkd_pack_set_subscribe() argument
232 packet[0] = htonl(LMK_SUBSCRIBE); in lmkd_pack_set_subscribe()
233 packet[1] = htonl((int)evt_type); in lmkd_pack_set_subscribe()
241 static inline size_t lmkd_pack_set_prockills(LMKD_CTRL_PACKET packet, pid_t pid, uid_t uid) { in lmkd_pack_set_prockills() argument
242 packet[0] = htonl(LMK_PROCKILL); in lmkd_pack_set_prockills()
243 packet[1] = htonl(pid); in lmkd_pack_set_prockills()
244 packet[2] = htonl(uid); in lmkd_pack_set_prockills()
252 static inline size_t lmkd_pack_set_update_props(LMKD_CTRL_PACKET packet) { in lmkd_pack_set_update_props() argument
253 packet[0] = htonl(LMK_UPDATE_PROPS); in lmkd_pack_set_update_props()
261 static inline size_t lmkd_pack_set_update_props_repl(LMKD_CTRL_PACKET packet, int result) { in lmkd_pack_set_update_props_repl() argument
262 packet[0] = htonl(LMK_UPDATE_PROPS); in lmkd_pack_set_update_props_repl()
263 packet[1] = htonl(result); in lmkd_pack_set_update_props_repl()
276 static inline void lmkd_pack_get_update_props_repl(LMKD_CTRL_PACKET packet, in lmkd_pack_get_update_props_repl() argument
278 params->result = ntohl(packet[1]); in lmkd_pack_get_update_props_repl()