rtl_sched.patch

来自「fsmlabs的real time linux的内核」· PATCH 代码 · 共 35 行

PATCH
35
字号
--- rtl_sched.c.org	Sun Sep 15 13:14:09 2002+++ rtl_sched.c	Sun Sep 15 14:01:11 2002@@ -584,18 +584,27 @@ 	pthread_attr_t default_attr; 	int stack_size; 	if (!attr) {+		/* if the creat is from rt-context the attributes must be+		 * passed to pthread_create  -  hofrat+		 */+		if (pthread_self() != pthread_linux()) {+			return EAGAIN;+		}+		else { 		pthread_attr_init(&default_attr); 		attr = &default_attr;+		} 	}  	stack_size = attr->stack_size; 	stack_addr = (int *) attr->stack_addr;  	if (!stack_addr) {-		if (pthread_self() != pthread_linux()) {-			return EAGAIN;-		}-		stack_addr = (int *) kmalloc(stack_size, GFP_KERNEL);+		/* as long as we use GFP_ATOMIC we should be safe (?) +		 * so no need to check if we are in kernel or rt-context+		 * hofrat+		 */+		stack_addr = (int *) kmalloc(stack_size, GFP_ATOMIC);  		task = (struct rtl_thread_struct *) stack_addr;  		if (!task) {   			return EAGAIN;

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?