Sponsored Content
Top Forums Programming Linux Kernel code "current" macro Post 302534952 by kumaran_5555 on Wednesday 29th of June 2011 08:23:14 AM
Old 06-29-2011
Linux Kernel code "current" macro

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.

Code:
/* how to get the thread information struct from C */
static inline struct thread_info *current_thread_info(void)
{
    struct thread_info *ti;
    __asm__("andl %%esp,%0; ":"=r" (ti) : "0" (~(THREAD_SIZE - 1)));
    return ti;
}

I have understood the point that it is being taken from kernel mode stack of size 8192 bytes. But couldn't understand the assembly langauage instruction.

Last edited by kumaran_5555; 06-29-2011 at 09:44 AM..
 

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 09:46 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy