Example #1
0
ATerm lf_8 ( ATerm arg0 ) {
{
ATerm tmp [ 2 ] ;
FUNC_ENTRY ( lf_8sym , ATmakeAppl ( lf_8sym , arg0 ) ) ;
if ( check_sym ( arg0 , lf_list_6sym ) ) {
( tmp [ 1 ] = arg_0 ( arg0 ) ) ;
{
ATerm atmp001110 ;
ATerm atmp00110 [ 2 ] ;
ATerm atmp0010 ;
ATerm atmp000 [ 2 ] ;
( atmp000 [ 0 ] = tmp [ 1 ] ) ;
( atmp000 [ 1 ] = tmp [ 1 ] ) ;
while ( not_empty_list ( tmp [ 1 ] ) ) {
( atmp0010 = list_head ( tmp [ 1 ] ) ) ;
( tmp [ 1 ] = list_tail ( tmp [ 1 ] ) ) ;
( atmp00110 [ 0 ] = tmp [ 1 ] ) ;
( atmp00110 [ 1 ] = tmp [ 1 ] ) ;
while ( not_empty_list ( tmp [ 1 ] ) ) {
( atmp001110 = list_head ( tmp [ 1 ] ) ) ;
( tmp [ 1 ] = list_tail ( tmp [ 1 ] ) ) ;
if ( term_equal ( atmp0010 , atmp001110 ) ) {
FUNC_EXIT ( lf_8_recursive ( cons ( slice ( atmp000 [ 0 ] , atmp000 [ 1 ] ) , cons ( make_list ( atmp0010 ) , cons ( slice ( atmp00110 [ 0 ] , atmp00110 [ 1 ] ) , tmp [ 1 ] ) ) ) ) ) ;
}
( atmp00110 [ 1 ] = list_tail ( atmp00110 [ 1 ] ) ) ;
( tmp [ 1 ] = atmp00110 [ 1 ] ) ;
}
( atmp000 [ 1 ] = list_tail ( atmp000 [ 1 ] ) ) ;
( tmp [ 1 ] = atmp000 [ 1 ] ) ;
}
}
}
FUNC_EXIT ( make_nf1 ( lf_8sym , arg0 ) ) ;
}
}
/*
* This function only be used for sending MUX control frame.
*/
int ts27010_uart_control_send(struct ts0710_con *ts0710, u8 *buf, u32 len)
{
	int ret = -EIO;
	FUNC_ENTER();

#ifdef DUMP_FRAME
	if (g_mux_uart_dump_frame)
		mux_uart_hexdump(MSG_ERROR, "send control frame",
			__func__, __LINE__, buf, len);
	else
		mux_uart_hexdump(MSG_MSGDUMP, "send control frame",
			__func__, __LINE__, buf, len);
#endif

#ifdef UART_LOOP
	return ts27010_uart_control_send_loop(ts0710, buf, len);
#endif

#ifdef MUX_UART_LOGGER
	ts27010_mux_uart_logger_logdata(g_mux_uart_logger, buf, len, 1);
#endif
	ret = ts27010_ldisc_uart_send(ts27010mux_uart_tty, buf, len);
	if (ret != len) {
		mux_print(MSG_ERROR, "ldisc send error %d(%d)\n", ret, len);
		ret = -EIO;
	}

	FUNC_EXIT();
	return ret;
}
RESULT HQRenderSystem::SwapScreenBuffer() {
	FUNC_ENTER();
	InternalWindow* internal_win = (InternalWindow*)window;
	glXSwapBuffers(internal_win->m_pDisplay, internal_win->m_Window);
	FUNC_EXIT();
	return HQRESULT_SUCCESS;
}
void mt_ppm_ptpod_policy_deactivate(void)
{
	unsigned int i;

	FUNC_ENTER(FUNC_LV_API);

	ppm_lock(&ptpod_policy.lock);

	/* deactivate ptpod policy */
	if (ptpod_policy.is_activated) {
		ptpod_policy.is_activated = false;

		/* restore to default setting */
		for (i = 0; i < ptpod_policy.req.cluster_num; i++) {
			ptpod_policy.req.limit[i].min_cpufreq_idx = get_cluster_min_cpufreq_idx(i);
			ptpod_policy.req.limit[i].max_cpufreq_idx = get_cluster_max_cpufreq_idx(i);
		}

		ppm_unlock(&ptpod_policy.lock);

		ppm_task_wakeup();
	} else
		ppm_unlock(&ptpod_policy.lock);

	FUNC_EXIT(FUNC_LV_API);
}
static int __init ppm_lcmoff_policy_init(void)
{
	int ret = 0;

	FUNC_ENTER(FUNC_LV_POLICY);

#ifdef CONFIG_HAS_EARLYSUSPEND
	register_early_suspend(&ppm_lcmoff_es_handler);
#else
	if (fb_register_client(&ppm_lcmoff_fb_notifier)) {
		ppm_err("@%s: lcmoff policy register FB client failed!\n", __func__);
		ret = -EINVAL;
		goto out;
	}
#endif

	if (ppm_main_register_policy(&lcmoff_policy)) {
		ppm_err("@%s: lcmoff policy register failed\n", __func__);
		ret = -EINVAL;
		goto out;
	}

	ppm_info("@%s: register %s done!\n", __func__, lcmoff_policy.name);

out:
	FUNC_EXIT(FUNC_LV_POLICY);

	return ret;
}
static int ppm_lcmoff_fb_notifier_callback(struct notifier_block *self, unsigned long event, void *data)
{
	struct fb_event *evdata = data;
	int blank;

	FUNC_ENTER(FUNC_LV_POLICY);

	blank = *(int *)evdata->data;
	ppm_ver("@%s: blank = %d, event = %lu\n", __func__, blank, event);

	/* skip if it's not a blank event */
	if (event != FB_EVENT_BLANK)
		return 0;

	switch (blank) {
	/* LCM ON */
	case FB_BLANK_UNBLANK:
		ppm_lcmoff_switch(1);
		break;
	/* LCM OFF */
	case FB_BLANK_POWERDOWN:
		ppm_lcmoff_switch(0);
		break;
	default:
		break;
	}

	FUNC_EXIT(FUNC_LV_POLICY);

	return 0;
}
void mt_ppm_ptpod_policy_activate(void)
{
	unsigned int i;

	FUNC_ENTER(FUNC_LV_API);

	ppm_lock(&ptpod_policy.lock);

	if (!ptpod_policy.is_enabled) {
		ppm_warn("@%s: ptpod policy is not enabled!\n", __func__);
		ppm_unlock(&ptpod_policy.lock);
		goto end;
	}

	ptpod_policy.is_activated = true;
	for (i = 0; i < ptpod_policy.req.cluster_num; i++) {
		/* FREQ is the same for each cluster? */
		ptpod_policy.req.limit[i].min_cpufreq_idx =
			get_cluster_ptpod_fix_freq_idx(i);
		ptpod_policy.req.limit[i].max_cpufreq_idx =
			get_cluster_ptpod_fix_freq_idx(i);
	}
	ppm_unlock(&ptpod_policy.lock);
	ppm_task_wakeup();

end:
	FUNC_EXIT(FUNC_LV_API);
}
Example #8
0
ATerm lf_2 ( ATerm arg0 , ATerm arg1 ) {
{
ATerm tmp [ 2 ] ;
FUNC_ENTRY ( lf_2sym , ATmakeAppl ( lf_2sym , arg0 , arg1 ) ) ;
if ( check_sym ( arg1 , lf_list_1sym ) ) {
( tmp [ 1 ] = arg_0 ( arg1 ) ) ;
{
ATerm atmp1010 ;
ATerm atmp100 [ 2 ] ;
( atmp100 [ 0 ] = tmp [ 1 ] ) ;
( atmp100 [ 1 ] = tmp [ 1 ] ) ;
while ( not_empty_list ( tmp [ 1 ] ) ) {
( atmp1010 = list_head ( tmp [ 1 ] ) ) ;
( tmp [ 1 ] = list_tail ( tmp [ 1 ] ) ) ;
if ( term_equal ( arg0 , atmp1010 ) ) {
FUNC_EXIT_CONST ( constant0 , make_nf0 ( lf_3sym ) ) ;
}
( atmp100 [ 1 ] = list_tail ( atmp100 [ 1 ] ) ) ;
( tmp [ 1 ] = atmp100 [ 1 ] ) ;
}
}
}
if ( check_sym ( arg1 , lf_list_1sym ) ) {
{
ATerm atmp10 = arg_0 ( arg1 ) ;
FUNC_EXIT_CONST ( constant1 , make_nf0 ( lf_4sym ) ) ;
}
}
FUNC_EXIT ( make_nf2 ( lf_2sym , arg0 , arg1 ) ) ;
}
}
static void ppm_ptpod_status_change_cb(bool enable)
{
	FUNC_ENTER(FUNC_LV_POLICY);

	ppm_ver("@%s: ptpod policy status changed to %d\n", __func__, enable);

	FUNC_EXIT(FUNC_LV_POLICY);
}
static void __exit ppm_ptpod_policy_exit(void)
{
	FUNC_ENTER(FUNC_LV_POLICY);

	ppm_main_unregister_policy(&ptpod_policy);

	FUNC_EXIT(FUNC_LV_POLICY);
}
static void ppm_ptpod_mode_change_cb(enum ppm_mode mode)
{
	FUNC_ENTER(FUNC_LV_POLICY);

	ppm_ver("@%s: ppm mode changed to %d\n", __func__, mode);

	FUNC_EXIT(FUNC_LV_POLICY);
}
/* only send UIH from APPs */
int ts27010_uart_uih_send(struct ts0710_con *ts0710, u8 *data, u32 len)
{
	int ret = -EIO;
	u8 dlci;
#ifdef TS27010_UART_RETRAN
	u8 index;
#endif
	FUNC_ENTER();

	mux_print(MSG_MSGDUMP, "will send UIH frame %d bytes\n", len);
#ifdef DUMP_FRAME
	if (g_mux_uart_dump_frame)
		mux_uart_hexdump(MSG_ERROR, "send UIH frame",
			__func__, __LINE__, data, len);
	else
		mux_uart_hexdump(MSG_MSGDUMP, "send UIH frame",
			__func__, __LINE__, data, len);
#endif

#ifdef UART_LOOP
	return ts27010_uart_uih_send_loop(ts0710, data, len);
#endif

#ifdef MUX_UART_LOGGER
	ts27010_mux_uart_logger_logdata(g_mux_uart_logger, data, len, 1);
#endif

	/* seems bellow state checking is unneccessary */
	dlci = *(data + ADDRESS_OFFSET) >> 2;
	if (ts0710->dlci[dlci].state == FLOW_STOPPED) {
		mux_print(MSG_WARNING, "Flow stopped on DLCI: %d\n", dlci);
		return -EBUSY;
	} else if (ts0710->dlci[dlci].state != CONNECTED) {
		mux_print(MSG_WARNING, "DLCI %d not connected\n", dlci);
		return -ENODEV;
	}

#ifdef TS27010_UART_RETRAN
	index = ts27010_slidewindo_store(s_slide_window, data, len);
	if (0xFF == index) {/* slide window is full, or get signal */
		/* TODO: trigger a panic or reset BP? */
		mux_print(MSG_ERROR, "slide window is full, block sending... "
			"should I report a panic?\n");
		return -EBUSY;
	}
	ret = ts27010_uart_driver_send(data, len, &s_mux_resend_lock);
	ts27010_slidewindow_lock(s_slide_window);
	ts27010_mod_retran_timer(
		ts27010_slidewindow_peek(s_slide_window, index));
	ts27010_slidewindow_unlock(s_slide_window);
	ts27010_clear_timer_para(s_timer_para, index);
#else
	ret = ts27010_uart_driver_send(data, len, NULL);
#endif

	FUNC_EXIT();
	return ret;
}
static void ppm_ptpod_update_limit_cb(enum ppm_power_state new_state)
{
	FUNC_ENTER(FUNC_LV_POLICY);

	ppm_ver("@%s: ptpod policy update limit for new state = %s\n",
		__func__, ppm_get_power_state_name(new_state));

	FUNC_EXIT(FUNC_LV_POLICY);
}
static void __exit ppm_ut_policy_exit(void)
{
	FUNC_ENTER(FUNC_LV_POLICY);

	kfree(ut_data.limit);

	ppm_main_unregister_policy(&ut_policy);

	FUNC_EXIT(FUNC_LV_POLICY);
}
Example #15
0
ATerm lf_5_recursive ( ATerm arg0 ) {
{
ATerm tmp [ 7 ] ;
FUNC_ENTRY ( lf_5_recursivesym , ATmakeAppl ( lf_5_recursivesym , arg0 ) ) ;
( tmp [ 1 ] = arg0 ) ;
{
ATerm atmp001110 ;
ATerm atmp00110 [ 2 ] ;
ATerm atmp0010 ;
ATerm atmp000 [ 2 ] ;
( atmp000 [ 0 ] = tmp [ 1 ] ) ;
( atmp000 [ 1 ] = tmp [ 1 ] ) ;
while ( not_empty_list ( tmp [ 1 ] ) ) {
( atmp0010 = list_head ( tmp [ 1 ] ) ) ;
( tmp [ 1 ] = list_tail ( tmp [ 1 ] ) ) ;
( atmp00110 [ 0 ] = tmp [ 1 ] ) ;
( atmp00110 [ 1 ] = tmp [ 1 ] ) ;
while ( not_empty_list ( tmp [ 1 ] ) ) {
( atmp001110 = list_head ( tmp [ 1 ] ) ) ;
( tmp [ 1 ] = list_tail ( tmp [ 1 ] ) ) ;
if ( term_equal ( atmp0010 , atmp001110 ) ) {
( tmp [ 2 ] = lf_5_recursive ( cons ( make_list ( atmp0010 ) , tmp [ 1 ] ) ) ) ;
if ( check_sym ( tmp [ 2 ] , lf_5_recursivesym ) ) {
( tmp [ 3 ] = arg_0 ( tmp [ 2 ] ) ) ;
( tmp [ 4 ] = arg_0 ( tmp [ 3 ] ) ) ;
if ( not_empty_list ( tmp [ 4 ] ) ) {
( tmp [ 5 ] = list_head ( tmp [ 4 ] ) ) ;
( tmp [ 4 ] = list_tail ( tmp [ 4 ] ) ) ;
( tmp [ 6 ] = lf_5_recursive ( cons ( slice ( atmp000 [ 0 ] , atmp000 [ 1 ] ) , cons ( make_list ( tmp [ 5 ] ) , cons ( slice ( atmp00110 [ 0 ] , atmp00110 [ 1 ] ) , tmp [ 4 ] ) ) ) ) ) ;
FUNC_EXIT ( tmp [ 6 ] ) ;
}
}
}
( atmp00110 [ 1 ] = list_tail ( atmp00110 [ 1 ] ) ) ;
( tmp [ 1 ] = atmp00110 [ 1 ] ) ;
}
( atmp000 [ 1 ] = list_tail ( atmp000 [ 1 ] ) ) ;
( tmp [ 1 ] = atmp000 [ 1 ] ) ;
}
}
FUNC_EXIT ( make_nf1 ( lf_5_recursivesym , lf_list_1 ( arg0 ) ) ) ;
}
}
static int __init ppm_ut_policy_init(void)
{
	int i, ret = 0;

	struct pentry {
		const char *name;
		const struct file_operations *fops;
	};

	const struct pentry entries[] = {
		PROC_ENTRY(ut_fix_core_num),
		PROC_ENTRY(ut_fix_freq_idx),
	};

	FUNC_ENTER(FUNC_LV_POLICY);

	/* create procfs */
	for (i = 0; i < ARRAY_SIZE(entries); i++) {
		if (!proc_create(entries[i].name, S_IRUGO | S_IWUSR | S_IWGRP, policy_dir, entries[i].fops)) {
			ppm_err("%s(), create /proc/ppm/policy/%s failed\n", __func__, entries[i].name);
			ret = -EINVAL;
			goto out;
		}
	}

	ut_data.limit = kcalloc(ppm_main_info.cluster_num, sizeof(*ut_data.limit), GFP_KERNEL);
	if (!ut_data.limit) {
		ret = -ENOMEM;
		goto out;
	}

	/* init ut_data */
	ut_data.is_freq_idx_fixed = false;
	ut_data.is_core_num_fixed = false;
	for (i = 0; i < ppm_main_info.cluster_num; i++) {
		ut_data.limit[i].freq_idx = -1;
		ut_data.limit[i].core_num = -1;
	}

	if (ppm_main_register_policy(&ut_policy)) {
		ppm_err("@%s: UT policy register failed\n", __func__);
		ret = -EINVAL;
		kfree(ut_data.limit);
		goto out;
	}

	ppm_info("@%s: register %s done!\n", __func__, ut_policy.name);

out:
	FUNC_EXIT(FUNC_LV_POLICY);

	return ret;
}
static void ppm_thermal_update_limit_cb(enum ppm_power_state new_state)
{
	FUNC_ENTER(FUNC_LV_POLICY);

	ppm_ver("@%s: thermal policy update limit for new state = %s\n",
		__func__, ppm_get_power_state_name(new_state));

	ppm_hica_set_default_limit_by_state(new_state, &thermal_policy);

	/* update limit according to power budget */
	ppm_main_update_req_by_pwr(new_state, &thermal_policy.req);

	FUNC_EXIT(FUNC_LV_POLICY);
}
static void __exit ppm_lcmoff_policy_exit(void)
{
	FUNC_ENTER(FUNC_LV_POLICY);

#ifdef CONFIG_HAS_EARLYSUSPEND
	unregister_early_suspend(&ppm_lcmoff_es_handler);
#else
	fb_unregister_client(&ppm_lcmoff_fb_notifier);
#endif

	ppm_main_unregister_policy(&lcmoff_policy);

	FUNC_EXIT(FUNC_LV_POLICY);
}
Example #19
0
void
smap_txeof(void *arg)
{
	struct smap_softc *sc = arg;
	struct ifnet *ifp = &sc->ethercom.ec_if;
	struct smap_desc *d;
	int i;

	FUNC_ENTER();

	/* clear the timeout timer. */
	ifp->if_timer = 0;

	/* garbage collect */
	for (i = sc->tx_done_index;; i = (i + 1) & 0x3f) {
		u_int16_t stat;

		d = &sc->tx_desc[i];
		stat = d->stat;
		if (stat & SMAP_TXDESC_READY) {
			/* all descriptor processed. */
			break;
		} else if (stat & 0x7fff) {
			if (stat & (SMAP_TXDESC_ECOLL | SMAP_TXDESC_LCOLL |
			    SMAP_TXDESC_MCOLL | SMAP_TXDESC_SCOLL))
				ifp->if_collisions++;
			else
				ifp->if_oerrors++;
		} else {
			ifp->if_opackets++;
		}

		if (sc->tx_desc_cnt == 0)
			break;
		
		sc->tx_buf_freesize += ROUND4(d->sz);
		sc->tx_desc_cnt--;

		d->sz = 0;
		d->ptr = 0;
		d->stat = 0;
		_wbflush();
	}
	sc->tx_done_index = i;

	/* OK to start transmit */
	ifp->if_flags &= ~IFF_OACTIVE;

	FUNC_EXIT();
}
Example #20
0
static int ts27010_mux_net_start_xmit(struct sk_buff *skb,
										struct net_device *net)
{
	FUNC_ENTER();

	struct ts27010_mux_net *mux_net = (struct ts27010_mux_net *)netdev_priv(net);
	struct dlci_struct *dlci = mux_net->dlci;
	//struct sk_buff_head skb_list;
#ifdef ENABLE_MUX_NET_KREF_FEATURE
	muxnet_get(mux_net);
#endif

	if (!skb) {
		mux_print(MSG_ERROR, "no skb\n");
		return -EINVAL;
	}

	mux_print(MSG_MSGDUMP, "ttyline = %d \n", dlci->line_no);
	mux_print(MSG_DEBUG, "net name : %s \n", net->name);
	mux_print(MSG_MSGDUMP, "net device address: %x \n", net);
	mux_print(MSG_MSGDUMP, "net->type : %d \n", net->type);
	mux_print(MSG_MSGDUMP, "skb->protocol : %x \n" , skb->protocol);
	mux_print(MSG_DEBUG, "skb data length = %d bytes\n", skb->len);

	int i = 0;
	int j = 15; //195;
	if (skb->len < j)
	j = (skb->len / 16) * 16 - 1;
	for (i = 0; i <= j; i = i + 16) {
		mux_print(MSG_MSGDUMP, "skb data %03d - %03d: %02x %02x %02x %02x %02x %02x %02x %02x  %02x %02x %02x %02x %02x %02x %02x %02x\n",
			i, i + 15, *(skb->data + i + 0), *(skb->data + i + 1), *(skb->data + i + 2), *(skb->data + i + 3),
			*(skb->data + i + 4), *(skb->data + i + 5), *(skb->data + i + 6), *(skb->data + i + 7),
			*(skb->data + i + 8), *(skb->data + i + 9), *(skb->data + i + 10), *(skb->data + i + 11),
			*(skb->data + i + 12), *(skb->data + i +13), *(skb->data + i + 14), *(skb->data + i + 15));
	}

	if ( mux_net->net_wq != NULL ) {
		mux_net->net = net;
		skb_queue_tail(&mux_net->txhead, skb);
		queue_delayed_work(mux_net->net_wq, &mux_net->net_work, 0);
	} else {
		mux_print(MSG_ERROR, "[WQ] mux_net->net_wq = NULL\n");
		mux_net->net = NULL;
		kfree_skb(skb);
		return -1;
	}
	FUNC_EXIT();
	return NETDEV_TX_OK;
}
static int ts27010_uart_driver_send(
	u8 *data, u32 len, struct wake_lock *mux_resend_lock)
{
	int ret;
	FUNC_ENTER();

	ret = ts27010_ldisc_uart_send(ts27010mux_uart_tty, data, len);
	if (ret < 0) {
		mux_print(MSG_ERROR, "pkt write error %d\n", ret);
		ret = -EIO;
	} else if (ret != len) {
		mux_print(MSG_ERROR, "short write %d < %d\n", ret, len);
		ret = -EIO;
	}
	FUNC_EXIT();
	return ret;
}
static void transfer_timeout(unsigned long para)
{
	FUNC_ENTER();
	mux_print(MSG_INFO,
		"transfer_timeout, para= %ld, slide_window.head=%d, "
		"tail=%d, jiffies: %lu\n",
		para, ts27010_slidewindow_head(s_slide_window),
		ts27010_slidewindow_tail(s_slide_window), jiffies);

	if (para >= SLIDE_WINDOWS_SIZE_AP) {
		mux_print(MSG_ERROR, "illegal para: %ld", para);
		return;
	}
	ts27010_inc_timer_para(s_timer_para, para);
	ts27010_sched_retran(s_timer_para);

	FUNC_EXIT();
}
static int __init ppm_ptpod_policy_init(void)
{
	int ret = 0;

	FUNC_ENTER(FUNC_LV_POLICY);

	if (ppm_main_register_policy(&ptpod_policy)) {
		ppm_err("@%s: ptpod policy register failed\n", __func__);
		ret = -EINVAL;
		goto out;
	}

	ppm_info("@%s: register %s done!\n", __func__, ptpod_policy.name);

out:
	FUNC_EXIT(FUNC_LV_POLICY);

	return ret;
}
static int tty_push(struct tty_struct *tty, u8 *buf, int len)
{
	int sent = 0;
	FUNC_ENTER();
	while (sent < len) {
		int count = tty_insert_flip_string(
			tty, buf + sent, len - sent);
		if (count != (len - sent)) {
			mux_print(MSG_WARNING,
				"written size %d is not wanted %d\n",
				count, len - sent);
		}
		sent += count;
		/* tty_flip_buffer_push(tty); */
	}
	tty_flip_buffer_push(tty);
	FUNC_EXIT();
	return sent;
}
static void ppm_lcmoff_update_limit_cb(enum ppm_power_state new_state)
{
	unsigned int i;

	FUNC_ENTER(FUNC_LV_POLICY);

	ppm_ver("@%s: lcmoff policy update limit for new state = %s\n",
		__func__, ppm_get_power_state_name(new_state));

	ppm_hica_set_default_limit_by_state(new_state, &lcmoff_policy);

	for (i = 0; i < lcmoff_policy.req.cluster_num; i++) {
		if (lcmoff_policy.req.limit[i].min_cpufreq_idx != -1) {
			int idx = ppm_main_freq_to_idx(i, get_cluster_lcmoff_min_freq(i), CPUFREQ_RELATION_L);

			lcmoff_policy.req.limit[i].min_cpufreq_idx =
				MIN(lcmoff_policy.req.limit[i].min_cpufreq_idx, idx);
		}
	}

	FUNC_EXIT(FUNC_LV_POLICY);
}
void mt_ppm_cpu_thermal_protect(unsigned int limited_power)
{
	FUNC_ENTER(FUNC_LV_POLICY);

	ppm_info("Get budget from thermal => limited_power = %d\n", limited_power);

	ppm_lock(&thermal_policy.lock);

	if (!thermal_policy.is_enabled) {
		ppm_warn("@%s: thermal policy is not enabled!\n", __func__);
		ppm_unlock(&thermal_policy.lock);
		goto end;
	}

	thermal_policy.req.power_budget = limited_power;
	thermal_policy.is_activated = (limited_power) ? true : false;
	ppm_unlock(&thermal_policy.lock);
	ppm_task_wakeup();

end:
	FUNC_EXIT(FUNC_LV_POLICY);
}
static void ppm_lcmoff_switch(int onoff)
{
	unsigned int i;

	FUNC_ENTER(FUNC_LV_POLICY);

	ppm_info("@%s: onoff = %d\n", __func__, onoff);

	ppm_lock(&lcmoff_policy.lock);

	/* onoff = 0: LCM OFF */
	/* others: LCM ON */
	if (onoff) {
		/* deactivate lcmoff policy */
		if (lcmoff_policy.is_activated) {
			lcmoff_policy.is_activated = false;
			for (i = 0; i < lcmoff_policy.req.cluster_num; i++) {
				lcmoff_policy.req.limit[i].min_cpufreq_idx = get_cluster_min_cpufreq_idx(i);
				lcmoff_policy.req.limit[i].max_cpufreq_idx = get_cluster_max_cpufreq_idx(i);
				lcmoff_policy.req.limit[i].min_cpu_core = get_cluster_min_cpu_core(i);
				lcmoff_policy.req.limit[i].max_cpu_core = get_cluster_max_cpu_core(i);
			}
			ppm_unlock(&lcmoff_policy.lock);
			ppm_task_wakeup();
		} else
			ppm_unlock(&lcmoff_policy.lock);
	} else {
		/* activate lcmoff policy */
		if (lcmoff_policy.is_enabled) {
			lcmoff_policy.is_activated = true;
			ppm_unlock(&lcmoff_policy.lock);
			ppm_task_wakeup();
		} else
			ppm_unlock(&lcmoff_policy.lock);
	}

	FUNC_EXIT(FUNC_LV_POLICY);
}
Example #28
0
ATerm lf_list_1 ( ATerm arg0 ) {
{
ATerm tmp [ 1 ] ;
FUNC_ENTRY ( lf_list_1sym , ATmakeAppl ( lf_list_1sym , arg0 ) ) ;
{
ATerm ltmp [ 1 ] ;
lbl_lf_list_1 : ltmp [ 0 ] = arg0 ;
( tmp [ 0 ] = ltmp [ 0 ] ) ;
{
ATerm atmp01110 ;
ATerm atmp0110 [ 2 ] ;
ATerm atmp010 ;
ATerm atmp00 [ 2 ] ;
( atmp00 [ 0 ] = tmp [ 0 ] ) ;
( atmp00 [ 1 ] = tmp [ 0 ] ) ;
while ( not_empty_list ( tmp [ 0 ] ) ) {
( atmp010 = list_head ( tmp [ 0 ] ) ) ;
( tmp [ 0 ] = list_tail ( tmp [ 0 ] ) ) ;
( atmp0110 [ 0 ] = tmp [ 0 ] ) ;
( atmp0110 [ 1 ] = tmp [ 0 ] ) ;
while ( not_empty_list ( tmp [ 0 ] ) ) {
( atmp01110 = list_head ( tmp [ 0 ] ) ) ;
( tmp [ 0 ] = list_tail ( tmp [ 0 ] ) ) ;
if ( term_equal ( atmp010 , atmp01110 ) ) {
( arg0 = cons ( slice ( atmp00 [ 0 ] , atmp00 [ 1 ] ) , cons ( make_list ( atmp010 ) , cons ( slice ( atmp0110 [ 0 ] , atmp0110 [ 1 ] ) , tmp [ 0 ] ) ) ) ) ;
goto lbl_lf_list_1 ;
}
( atmp0110 [ 1 ] = list_tail ( atmp0110 [ 1 ] ) ) ;
( tmp [ 0 ] = atmp0110 [ 1 ] ) ;
}
( atmp00 [ 1 ] = list_tail ( atmp00 [ 1 ] ) ) ;
( tmp [ 0 ] = atmp00 [ 1 ] ) ;
}
}
FUNC_EXIT ( make_nf1 ( lf_list_1sym , ltmp [ 0 ] ) ) ;
}
}
}
RESULT HQRenderSystem::ClearBackBuffer(REAL R, REAL G, REAL B, REAL A) {
	FUNC_ENTER();
	glClearColor(R, G, B, A);
	glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);
/*
	glMatrixMode(GL_PROJECTION);
	glLoadIdentity();
	glOrtho(-1., 1., -1., 1., 1., 20.);

	glMatrixMode(GL_MODELVIEW);
	glLoadIdentity();
	gluLookAt(0., 0., 10., 0., 0., 0., 0., 1., 0.);

	glBegin(GL_QUADS);
	glColor3f(1., 0., 0.); glVertex3f(-.75, -.75, 0.);
	glColor3f(0., 1., 0.); glVertex3f( .75, -.75, 0.);
	glColor3f(0., 0., 1.); glVertex3f( .75,  .75, 0.);
	glColor3f(1., 1., 0.); glVertex3f(-.75,  .75, 0.);
	glEnd();
*/
	FUNC_EXIT();
	return HQRESULT_SUCCESS;
}
static int __init ppm_thermal_policy_init(void)
{
	int i, ret = 0;

	struct pentry {
		const char *name;
		const struct file_operations *fops;
	};

	const struct pentry entries[] = {
		PROC_ENTRY(thermal_limit),
	};

	FUNC_ENTER(FUNC_LV_POLICY);

	/* create procfs */
	for (i = 0; i < ARRAY_SIZE(entries); i++) {
		if (!proc_create(entries[i].name, S_IRUGO | S_IWUSR | S_IWGRP, policy_dir, entries[i].fops)) {
			ppm_err("%s(), create /proc/ppm/policy/%s failed\n", __func__, entries[i].name);
			ret = -EINVAL;
			goto out;
		}
	}

	if (ppm_main_register_policy(&thermal_policy)) {
		ppm_err("@%s: thermal policy register failed\n", __func__);
		ret = -EINVAL;
		goto out;
	}

	ppm_info("@%s: register %s done!\n", __func__, thermal_policy.name);

out:
	FUNC_EXIT(FUNC_LV_POLICY);

	return ret;
}