From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: Content-Type: multipart/alternative; boundary="_1af8b667-06be-4f16-85ae-da7dba9855d1_" From: Jan-Erik Lange Date: Wed, 11 Jan 2012 19:12:44 +0100 MIME-Version: 1.0 Subject: [Xenomai-core] Question about context switching List-Id: Xenomai life and development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: xenomai@xenomai.org --_1af8b667-06be-4f16-85ae-da7dba9855d1_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hello=2C=20 =20 I have a question about the context switching:=20 =20 Unless that there a rtdm_copy_to_user() available in the rtdm API. Would ca= use the function copy_to_user() in an xenomai kernel based rt task a switch= into the secondary domain? Because copy_to_user() not actually a syscall r= ight? =20 Best regards Jan = --_1af8b667-06be-4f16-85ae-da7dba9855d1_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Hello=2C
 =3B
I have a question about the context switching:
 =3B
Unless that there a rtdm_copy_to_user() available in the rtdm API. Would ca= use the function copy_to_user() in an xenomai kernel based rt task a = =3Bswitch into the secondary domain? Because copy_to_user() not actually a = syscall right?
 =3B
Best regards
Jan
= --_1af8b667-06be-4f16-85ae-da7dba9855d1_-- From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <4F0DDCFD.3070902@domain.hid> Date: Wed, 11 Jan 2012 20:03:25 +0100 From: Gilles Chanteperdrix MIME-Version: 1.0 References: In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Xenomai-core] Question about context switching List-Id: Xenomai life and development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jan-Erik Lange Cc: xenomai@xenomai.org On 01/11/2012 07:12 PM, Jan-Erik Lange wrote: > > Hello, > > I have a question about the context switching: > > Unless that there a rtdm_copy_to_user() available in the rtdm API. > Would cause the function copy_to_user() in an xenomai kernel based rt > task a switch into the secondary domain? Because copy_to_user() not > actually a syscall right? Absolutely no function in kernel-space causes an automatic switch to secondary mode. As Philippe answered to the very first mail you posted to this list, the only events which cause a switch to secondary mode are: - invoking a regular linux syscall - receiving a linux signal (e.g. kill(2) and GDB) - causing a CPU trap (e.g. invalid memory access), hitting a breakpoint (e.g. GDB) All these events only happen for threads in user-space. -- Gilles. From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: Content-Type: multipart/alternative; boundary="_4cbe8604-7456-4678-a5b5-e6c3eb269809_" From: Jan-Erik Lange Date: Thu, 12 Jan 2012 14:36:21 +0100 In-Reply-To: References: , <4F0DDCFD.3070902@domain.hid>, MIME-Version: 1.0 Subject: [Xenomai-core] FW: Question about context switching List-Id: Xenomai life and development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: xenomai@xenomai.org --_4cbe8604-7456-4678-a5b5-e6c3eb269809_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable =20 > Date: Wed=2C 11 Jan 2012 20:03:25 +0100 > From: gilles.chanteperdrix@xenomai.org > To: jan0385@domain.hid > CC: xenomai@xenomai.org > Subject: Re: [Xenomai-core] Question about context switching >=20 > On 01/11/2012 07:12 PM=2C Jan-Erik Lange wrote: > >=20 > > Hello=2C > >=20 > > I have a question about the context switching: > >=20 > > Unless that there a rtdm_copy_to_user() available in the rtdm API. > > Would cause the function copy_to_user() in an xenomai kernel based rt > > task a switch into the secondary domain? Because copy_to_user() not > > actually a syscall right? >=20 > Absolutely no function in kernel-space causes an automatic switch to > secondary mode. As Philippe answered to the very first mail you posted > to this list=2C the only events which cause a switch to secondary mode ar= e: >=20 > - invoking a regular linux syscall > - receiving a linux signal (e.g. kill(2) and GDB) > - causing a CPU trap (e.g. invalid memory access)=2C hitting a breakpoint > (e.g. GDB) >=20 > All these events only happen for threads in user-space. Sorry I'm new in Xenomai. But is it generaly possible that the xenomai kernel-space task can interact= with a common Linux task over this way? I mean is it possible to get data = with the standard copy_to_user()-function from the Xenomai kernel-space int= o the Linux user space? Aren't the adress spaces strictly seperated and you= have to need the rt-pipe service to interact between the xenomai kernel sp= ace and the linux userspace? >=20 > --=20 > Gilles. = --_4cbe8604-7456-4678-a5b5-e6c3eb269809_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable

 =3B
>=3B Date: Wed=2C 11 Jan 2012 20:0= 3:25 +0100
>=3B From: gilles.chanteperdrix@xenomai.org
>=3B To: j= an0385@domain.hid
>=3B CC: xenomai@xenomai.org
>=3B Subject: Re:= [Xenomai-core] Question about context switching
>=3B
>=3B On 01= /11/2012 07:12 PM=2C Jan-Erik Lange wrote:
>=3B >=3B
>=3B >= =3B Hello=2C
>=3B >=3B
>=3B >=3B I have a question about the= context switching:
>=3B >=3B
>=3B >=3B Unless that there a = rtdm_copy_to_user() available in the rtdm API.
>=3B >=3B Would cause= the function copy_to_user() in an xenomai kernel based rt
>=3B >=3B= task a switch into the secondary domain? Because copy_to_user() not
>= =3B >=3B actually a syscall right?
>=3B
>=3B Absolutely no fun= ction in kernel-space causes an automatic switch to
>=3B secondary mod= e. As Philippe answered to the very first mail you posted
>=3B to this= list=2C the only events which cause a switch to secondary mode are:
>= =3B
>=3B - invoking a regular linux syscall
>=3B - receiving a l= inux signal (e.g. kill(2) and GDB)
>=3B - causing a CPU trap (e.g. inv= alid memory access)=2C hitting a breakpoint
>=3B (e.g. GDB)
>=3B =
>=3B All these events only happen for threads in user-space.

S= orry I'm new in Xenomai.

But is it generaly possible that the xenoma= i kernel-space task can interact with a common Linux task over this way? I = mean is it possible to get data with the standard copy_to_user()-function f= rom the Xenomai kernel-space into the Linux user space? Aren't the adress s= paces strictly seperated and you have to need the rt-pipe service to intera= ct between the xenomai kernel space and the linux userspace?

>=3B =
>=3B --
>=3B Gilles.
= --_4cbe8604-7456-4678-a5b5-e6c3eb269809_-- From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <4F0F379A.5030604@domain.hid> Date: Thu, 12 Jan 2012 20:42:18 +0100 From: Gilles Chanteperdrix MIME-Version: 1.0 References: , <4F0DDCFD.3070902@domain.hid>, In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Subject: Re: [Xenomai-core] FW: Question about context switching List-Id: Xenomai life and development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Jan-Erik Lange Cc: xenomai@xenomai.org On 01/12/2012 02:36 PM, Jan-Erik Lange wrote: > > > > > > >> Date: Wed, 11 Jan 2012 20:03:25 +0100 From: >> gilles.chanteperdrix@xenomai.org To: jan0385@domain.hid CC: >> xenomai@xenomai.org Subject: Re: [Xenomai-core] Question about >> context switching >> >> On 01/11/2012 07:12 PM, Jan-Erik Lange wrote: >>> >>> Hello, >>> >>> I have a question about the context switching: >>> >>> Unless that there a rtdm_copy_to_user() available in the rtdm >>> API. Would cause the function copy_to_user() in an xenomai kernel >>> based rt task a switch into the secondary domain? Because >>> copy_to_user() not actually a syscall right? >> >> Absolutely no function in kernel-space causes an automatic switch >> to secondary mode. As Philippe answered to the very first mail you >> posted to this list, the only events which cause a switch to >> secondary mode are: >> >> - invoking a regular linux syscall - receiving a linux signal (e.g. >> kill(2) and GDB) - causing a CPU trap (e.g. invalid memory access), >> hitting a breakpoint (e.g. GDB) >> >> All these events only happen for threads in user-space. > > Sorry I'm new in Xenomai. > > But is it generaly possible that the xenomai kernel-space task can > interact with a common Linux task over this way? I mean is it > possible to get data with the standard copy_to_user()-function from > the Xenomai kernel-space into the Linux user space? Aren't the adress > spaces strictly seperated and you have to need the rt-pipe service to > interact between the xenomai kernel space and the linux userspace? drivers should use rtdm_copy_to_user. As most linux kernel services, copy_to_user/copy_from_user may not be safe to be used in primary mode (depending on the architecture). A xenomai kernel-space task has no user-space mapping, so it has no reason to use these services. Whether the address space are strictly separated depend on the architecture and implementation of linux on that archietcture. On some architectures (think uclinux for instance), the user-space/kernel-space division is simply the division between the addresses below 0xC0000000 and the adresses above. -- Gilles.