-
Notifications
You must be signed in to change notification settings - Fork 0
arch.h
Burak Köken edited this page Apr 14, 2015
·
1 revision
arch.h header dosyası kernel'in ait olduğu mimariyle ilgili bazı tanımlamalar içerir. Bunlardan birisi olan kern__arch tanımlamasıyla kernelin hangi mimariye sahip olduğuna göre işlemler yapılabilir.
Header dosyasının dahil edilmesi :
#include <arch.h>arch.h :
/*
* Copyright(C) 2014 Codnect Team
* Copyright(C) 2014 Burak Köken
*
* This file is part of Uniq.
*
* Uniq is free software: you can redistribute it and/or modify it under the
* terms of the GNU General Public License as published by the Free Software
* Foundation, version 2 of the License.
*
* Uniq is distributed in the hope that it will be useful, but WITHOUT ANY
* WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
* details.
*
* You should have received a copy of the GNU General Public License along
* with Uniq. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __UNIQ_ARCH_H__
#define __UNIQ_ARCH_H__
#define __arch_i386__ 386
#define __arch_i486__ 486
#define __arch_i586__ 586
#define __arch_i686__ 686
#define __kern_arch__ __arch_i386__
#endif /* __UNIQ_ARCH_H__ */###Kullanımı Örneğin mem.c kaynak kod dosyasında bu tanımlamaların kullanıldığını görebiliriz. Bazı işlemci komutlarının daha eski mimarilerde çalışmayacağından dolayı aşağıdaki kodu incelerseniz aşağıdaki şekilde önlemler alınabilir.
...
#include <arch.h>
...
#if (__kern_arch__ > __arch_i386__)
...
#endif- x86 Mimarisi
- Kod Açıklamaları
-
Include
- Drivers
- Mm
- heap.h
- mem.h
- shared_mem.h
- Uniq
- ansi_color.h
- args.h
- asm.h
- cpuid.h
- elf.h
- errno.h
- errno_list.h
- kern_debug.h
- kern_lvls.h
- kernel.h
- module.h
- multiboot.h
- port.h
- posix_types.h
- proc.h
- regs.h
- signal.h
- spin_lock.h
- syscall_nums.h
- task.h
- time.h
- tss.h
- types.h
- utsname.h
- version.h
- arch.h
- compiler.h
- compiler_gcc.h
- ctype.h
- hashmap.h
- linked_list.h
- list.h
- string.h
- tree.h
- ulib.h
- va_list.h
- Init
- Kernel
- Libs
- Memory Management
- Makefile
- Makefile.am
- link.ld