aboutsummaryrefslogtreecommitdiffstats
path: root/arch/microblaze/include/asm/mman.h
blob: 4914b1329445ed1b7f3bef722b3984bd7f726533 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/*
 * Copyright (C) 2006 Atmark Techno, Inc.
 *
 * This file is subject to the terms and conditions of the GNU General Public
 * License. See the file "COPYING" in the main directory of this archive
 * for more details.
 */

#ifndef _ASM_MICROBLAZE_MMAN_H
#define _ASM_MICROBLAZE_MMAN_H

#include <asm-generic/mman.h>

#define MAP_GROWSDOWN	0x0100 /* stack-like segment */
#define MAP_DENYWRITE	0x0800 /* ETXTBSY */
#define MAP_EXECUTABLE	0x1000 /* mark it as an executable */
#define MAP_LOCKED	0x2000 /* pages are locked */
#define MAP_NORESERVE	0x4000 /* don't check for reservations */
#define MAP_POPULATE	0x8000 /* populate (prefault) pagetables */
#define MAP_NONBLOCK	0x10000 /* do not block on IO */

#define MCL_CURRENT	1 /* lock all current mappings */
#define MCL_FUTURE	2 /* lock all future mappings */

#endif /* _ASM_MICROBLAZE_MMAN_H */
ef='#n27'>27 28 29 30 31 32 33 34 35 36 37 38 39 40 41
 
                                                                  











                                                                    
                                                       

























                                                                         

Export cpu topology info via sysfs. Items (attributes) are similar
to /proc/cpuinfo.

1) /sys/devices/system/cpu/cpuX/topology/physical_package_id:
represent the physical package id of  cpu X;
2) /sys/devices/system/cpu/cpuX/topology/core_id:
represent the cpu core id to cpu X;
3) /sys/devices/system/cpu/cpuX/topology/thread_siblings:
represent the thread siblings to cpu X in the same core;
4) /sys/devices/system/cpu/cpuX/topology/core_siblings:
represent the thread siblings to cpu X in the same physical package;

To implement it in an architecture-neutral way, a new source file,
drivers/base/topology.c, is to export the 4 attributes.

If one architecture wants to support this feature, it just needs to
implement 4 defines, typically in file include/asm-XXX/topology.h.
The 4 defines are:
#define topology_physical_package_id(cpu)
#define topology_core_id(cpu)
#define topology_thread_siblings(cpu)
#define topology_core_siblings(cpu)

The type of **_id is int.
The type of siblings is cpumask_t.

To be consistent on all architectures, the 4 attributes should have
deafult values if their values are unavailable. Below is the rule.
1) physical_package_id: If cpu has no physical package id, -1 is the
default value.
2) core_id: If cpu doesn't support multi-core, its core id is 0.
3) thread_siblings: Just include itself, if the cpu doesn't support
HT/multi-thread.
4) core_siblings: Just include itself, if the cpu doesn't support
multi-core and HT/Multi-thread.

So be careful when declaring the 4 defines in include/asm-XXX/topology.h.

If an attribute isn't defined on an architecture, it won't be exported.