Sponsored Content
Top Forums Programming Linux Kernel code "current" macro Post 302535013 by Corona688 on Wednesday 29th of June 2011 11:15:38 AM
Old 06-29-2011
Quote:
Originally Posted by kumaran_5555
I was going through the Linux code, i stuck with few inline assembly language code,

I have tried online but in vain. Any help is much appreciated. Thanks.
esp would be the x86 stack pointer. And %0 is a variable parameter which in this case means ~(THREAD_SIZE-1) The stack is the context which thread-local variables, among other things, reside inside. Each thread gets their own little independent chunk.

I believe they're doing something similar to aligning a pointer along page boundaries. If the stack pointer was, say 0xfeff7352 and THREAD_SIZE was 0x00010000, they'd be doing 0xfeff7352 & 0xffff0000, you'd get 0xfeff0000 out of it. I suppose doing this would get you the very top of the thread's stack instance, where (I think) things like the thread ID are kept handy.

THREAD_SIZE may not be the system page size but is probably at least a power-of-two multiple of it.
This User Gave Thanks to Corona688 For This Post:
 

4 More Discussions You Might Find Interesting

1. Solaris

Compliation Error in solaris - macro "min" requires 2 arguments, but only 1 given

Hi, I am trying to compile our linux code base in solaris and came across the following issues. Am I suppose to do something special ? Can anyone help me to fix this issue. System : uname -a SunOS aspen 5.10 Generic_125100-08 sun4u sparc SUNW,Sun-Fire-280R The complier that I am using is... (0 Replies)
Discussion started by: learningkid
0 Replies

2. Shell Programming and Scripting

"find command" to find the files in the current directories but not in the "subdir"

Dear friends, please tell me how to find the files which are existing in the current directory, but it sholud not search in the sub directories.. it is like this, current directory contains file1, file2, file3, dir1, dir2 and dir1 conatins file4, file5 and dir2 contains file6,... (9 Replies)
Discussion started by: swamymns
9 Replies

3. Linux

Supermicro(dual core) server getting rebooted after "decompressing the kernel;booting the kernel" me

supermicro(dual core) server getting rebooted after "decompressing the kernel;booting the kernel" message comes. I tried giving acpi=off to the kernel command line but same problem.It shows everything ok and no problem with memory and processors and power supplies.Wt could be the reason? It has... (1 Reply)
Discussion started by: pankajd
1 Replies

4. Shell Programming and Scripting

"find . -printf" without prepended "." path? Getting path to current working directory?

If I enter (simplified): find . -printf "%p\n" then all files in the output are prepended by a "." like ./local/share/test23.log How can achieve that a.) the leading "./" is omitted and/or b.) the full path to the current directory is inserted (enclosed by brackets and a blank)... (1 Reply)
Discussion started by: pstein
1 Replies
Helpers for manipulating Linux libnuma nodemask_t(3)	     Hardware Locality (hwloc)	      Helpers for manipulating Linux libnuma nodemask_t(3)

NAME
Helpers for manipulating Linux libnuma nodemask_t - Functions static inline int hwloc_cpuset_to_linux_libnuma_nodemask (hwloc_topology_t topology, hwloc_const_cpuset_t cpuset, nodemask_t *nodemask) static inline int hwloc_nodeset_to_linux_libnuma_nodemask (hwloc_topology_t topology, hwloc_const_nodeset_t nodeset, nodemask_t *nodemask) static inline int hwloc_cpuset_from_linux_libnuma_nodemask (hwloc_topology_t topology, hwloc_cpuset_t cpuset, const nodemask_t *nodemask) static inline int hwloc_nodeset_from_linux_libnuma_nodemask (hwloc_topology_t topology, hwloc_nodeset_t nodeset, const nodemask_t *nodemask) Detailed Description Note: The Linux libnuma nodemask_t interface is deprecated and its implementation is at least incorrect with respect to sparse NUMA node ids. It is strongly advised to use struct bitmask instead of nodemask_t, or even to use hwloc directly. Function Documentation static inline int hwloc_cpuset_from_linux_libnuma_nodemask (hwloc_topology_ttopology, hwloc_cpuset_tcpuset, const nodemask_t *nodemask) [static] Convert libnuma nodemask nodemask into hwloc CPU set cpuset. This function may be used before calling some old libnuma functions that use a nodemask_t as an output parameter. static inline int hwloc_cpuset_to_linux_libnuma_nodemask (hwloc_topology_ttopology, hwloc_const_cpuset_tcpuset, nodemask_t *nodemask) [static] Convert hwloc CPU set cpuset into libnuma nodemask nodemask. This function may be used before calling some old libnuma functions that use a nodemask_t as an input parameter. static inline int hwloc_nodeset_from_linux_libnuma_nodemask (hwloc_topology_ttopology, hwloc_nodeset_tnodeset, const nodemask_t *nodemask) [static] Convert libnuma nodemask nodemask into hwloc NUMA node set nodeset. This function may be used before calling some old libnuma functions that use a nodemask_t as an output parameter. static inline int hwloc_nodeset_to_linux_libnuma_nodemask (hwloc_topology_ttopology, hwloc_const_nodeset_tnodeset, nodemask_t *nodemask) [static] Convert hwloc NUMA node set nodeset into libnuma nodemask nodemask. This function may be used before calling some old libnuma functions that use a nodemask_t as an input parameter. Author Generated automatically by Doxygen for Hardware Locality (hwloc) from the source code. Version 1.4.1 Mon Feb 27 2012 Helpers for manipulating Linux libnuma nodemask_t(3)
All times are GMT -4. The time now is 03:55 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy