コード例 #1
0
/* Note: it is necessary to treat pid as an unsigned int,
 * with the corresponding cast to a signed int to insure that the 
 * proper conversion (sign extension) between the register representation of a signed int (msr in 32-bit mode)
 * and the register representation of a signed int (msr in 64-bit mode) is performed.
 */
asmlinkage long compat_sys_sched_getscheduler(u32 pid)
{
	return sys_sched_getscheduler((int)pid);
}
コード例 #2
0
static void autok_thread_func(struct work_struct *data)
#endif  // USE_KERNEL_THREAD
{
    int err = 0;
    
    #ifdef USE_KERNEL_THREAD
    struct sdio_autok_thread_data *autok_thread_data = (struct sdio_autok_thread_data *)data;
    #else   // USE_KERNEL_THREAD
    struct sdio_autok_workqueue_data *autok_thread_data = (struct sdio_autok_workqueue_data *)data;
    #endif  // USE_KERNEL_THREAD
    
    struct msdc_host *host = autok_thread_data->host;
    char stage = autok_thread_data->stage;
    char *envp[2];
    char *lteprocenvp[2];
#ifdef CHANGE_SCHED_POLICY    
    struct sched_param param;
    int sched_policy;
    
    #ifdef SCHED_POLICY_INFO
    sched_policy = sys_sched_getscheduler(0);
    printk("[%s] orig. sched policy: %d\n", __func__, sched_policy);
    
    param.sched_priority = sys_sched_get_priority_max(SCHED_FIFO);
    if( sys_sched_setscheduler( 0, SCHED_FIFO, &param ) == -1 )
    {
    	printk("[%s] sched_setscheduler fail\n", __func__);
    }
    
    sched_policy = sys_sched_getscheduler(0);
    printk("[%s] sched policy FIFO: %d\n", __func__, sched_policy);
    #endif
    
    //param.sched_priority = sched_get_priority_max(SCHED_RR);
    param.sched_priority = 1;
    if( sys_sched_setscheduler( 0, SCHED_RR, &param ) == -1 )
    {
    	printk("[%s] sched_setscheduler fail\n", __func__);
    }
    
    #ifdef SCHED_POLICY_INFO
    sched_policy = sys_sched_getscheduler(0);
    printk("[%s] modified sched policy: %d\n", __func__, sched_policy);
    #endif
#endif    
    if(stage == 1) {
        // call stage 1 auto-K callback function
        msdc_autok_stg1_cal(host);
        
        envp[0] = "FROM=sdio_autok";
        envp[1] = NULL;
        err = kobject_uevent_env(&host->mmc->class_dev.kobj, KOBJ_ONLINE, envp);
        if(err < 0)
            printk(KERN_INFO "[%s] kobject_uevent_env error = %d\n", __func__, err);
    } else if(stage == 2) {
        // call stage 2 auto-K callback function
        msdc_autok_stg2_cal(host, autok_thread_data->autok_stage1_result, autok_thread_data->len);
    } else {
        printk(KERN_INFO "[%s] stage %d doesn't support in auto-K\n", __func__, stage);
#ifdef USE_KERNEL_THREAD
        return -EFAULT;
#else   // USE_KERNEL_THREAD
        return;
#endif  // USE_KERNEL_THREAD
    }
    
    lteprocenvp[0] = "FROM=autok_done";
    lteprocenvp[1] = NULL;
    err = kobject_uevent_env(&host->mmc->class_dev.kobj, KOBJ_ONLINE, lteprocenvp);
    if(err < 0)
        printk(KERN_INFO "[%s] kobject_uevent_env error = %d\n", __func__, err);
    
#ifdef USE_KERNEL_THREAD
    return 0;
#else   // USE_KERNEL_THREAD
    return;
#endif  // USE_KERNEL_THREAD
}