linux/block/partitions/mac.c
<<
>>
Prefs
   1/*
   2 *  fs/partitions/mac.c
   3 *
   4 *  Code extracted from drivers/block/genhd.c
   5 *  Copyright (C) 1991-1998  Linus Torvalds
   6 *  Re-organised Feb 1998 Russell King
   7 */
   8
   9#include <linux/ctype.h>
  10#include "check.h"
  11#include "mac.h"
  12
  13#ifdef CONFIG_PPC_PMAC
  14#include <asm/machdep.h>
  15extern void note_bootable_part(dev_t dev, int part, int goodness);
  16#endif
  17
  18/*
  19 * Code to understand MacOS partition tables.
  20 */
  21
  22static inline void mac_fix_string(char *stg, int len)
  23{
  24        int i;
  25
  26        for (i = len - 1; i >= 0 && stg[i] == ' '; i--)
  27                stg[i] = 0;
  28}
  29
  30int mac_partition(struct parsed_partitions *state)
  31{
  32        Sector sect;
  33        unsigned char *data;
  34        int slot, blocks_in_map;
  35        unsigned secsize;
  36#ifdef CONFIG_PPC_PMAC
  37        int found_root = 0;
  38        int found_root_goodness = 0;
  39#endif
  40        struct mac_partition *part;
  41        struct mac_driver_desc *md;
  42
  43        /* Get 0th block and look at the first partition map entry. */
  44        md = read_part_sector(state, 0, &sect);
  45        if (!md)
  46                   oncl-1;
sect);
  32        state,iut_codeass="s="+code=sect" class="id="L45" class="line" name="L45">  45        if (!  39#endif
ma5_partition  29
51e=read_part_sector" class="#L36" id="L36" class="line" name=/a>(
<_6" id="L36" class="/a>
<_6" iname="L45">  45        if (!iut_codeass="sref">state,iut_codeass="s="+code=sect" class="id="L45" class="line" name="L45">  45        if (!5* Get 0th block and loo5 at t53="+code=sect" class="sref">id="L34" class="line" name=/a>(state, 0, &sect);
  45        if (!md =   46                   on5  Copyrigght (C) 1991-1998  Linus href55_driver_desc" clned id="L41" class="line" name=/a>itions *part;
  45        if (!sect);
  32        state,iut_codeass="s="+code=sect" class="id="L45" class="line" name="L45">  45        if (!not a0" id="diskne" name="L44">  44        ma6_partition  29
61e=read_part_sector" class="itions/mac.c#L35" id="L35" class="line" name=/a>(  45        if (!  32        6* Get 0th block and loo6 at t63_driver_desc" clned ons/mac.c#L41" iut_codeass="sref">state,iut_codeass="s="+code=sect" class="id="L45" class="line" name="L45">  45        if (!md =   45        if (!  29
  43        sect);

	 t;= 0 &&i>
	ame="L46">  46                   on6code=fou6d_root_goodness" class=6sref"68_driver_desc" clned ons/mac.c#L41" itions/mac.c#L35" id="L35" class="line" name=/a>(sect);

	 t;= 0 &&i>
	ame=ref="L46">  46                   on6partitio6s/mac.c#L40" id="L40" c6ass="6ame="L30">  30int ma70e=read_part_sector" class="tiolca="L45" class="liniolca=="+code=sect" class="sref">sect);
state,ip_buf="blocsref">i--)
state,PAGE_SIZEname="L45">  45        if (!71e=read_part_ass="sref">len -sref">blocks_in_map;
="+code=stg" classsref">blocks_in_map;
(blocks_in_map;
  32        stateosame=/a>(blocks_in_map;
  36#ifdef 7* Get 0th block and loo7 at t73_driver_desc" clned ons/mac.c#L41" iut_codeass="sref">state,iut_codeass="s="+code=sect" class="id="L45" class="line" name="L45">  45        if (!md = id="L34" class="line" name=/a>(state, 0, &sect);
stateosame=/512/partitions/mac.c#L45" id="L45" class="line" name="L45">  45        if (!  46                   on7  Re-org7anised Feb 1998 Russell7c.c#L7c_driver_desc" clned " clned i] = id="L41" class="line" name=/a>itions *part;
stateosame=%512="L45">  45        if (!sect);
  45        if (!  45        if (!ma80_driver_desc" clned ons/mac.c#L41" iut_ass="sref">part;
sect);
blocks_in_map;
  45        if (!81_driver_desc" clned         (  ">sect);
  ame=" *="sref">len -sL36" id="L36" class="line" name=/512) L45">  45        if (!
<_coun"L41" class="lin/a>
<_coun"ame=" *="sref">len -sL36" id="L36" class="line" name=/512)="L45">  45        if (!8* Get 0th block and loo8 at t83me="L30">  30int md = i--)
  45        if (!sect);
state)
tsame=ons/mac.c#L28" i#ref">blocks_in_map;
(  36#ifdef   37        int   19  19  20ma9c.c#L21" id="L21" class="lin" clned         *" name="L44">  44        91_driver_desc" clned nclude/asm-alpak2="ass=esc_iions/mac.c#L39" ass=esc_ii="+code=sect" class=ip.h|ass"sref">stateo.h|assame="" "L32">  32          39#endif
9* Get 0th block and loo9 at t93me="L30">  30int md = stg, int state,iroce" "s="bloc16="L45">  45        if (!stg, int   45        if (!stg, int   45        if (!9
  45        if (!i] == na_STATUS_BOOTABLEref">state, na_STATUS_BOOTABLEame="L45">  45        if (!i] == state,iroce" "s="blocsref">i--)
  45        if (!ms=f_driver_desc" clned             ned (  10#include "ms=ame="L22">  22static ms=2_driver_desc" clned         bclude/asm-alpak2=" i--)
  22static CON03">ms=3_driver_desc" clned             ||lude/asm-alpak2=" i--)
  22static ms=4_driver_desc" clned                 =i" class="sref">i] == i--)
  32          36#ifdef ms=6me="L43">  43          10#include "0
 >= 0 &&am"sr> &+codede=sect" class=id="L41" class="line" name=-f="+ions/mac.c#L45"8  LL41" class="lin8  L="bl="L16">  16#endif
i--)
  45        if (!  10#include "ms11_driver_desc" clned                 ass="sref">len - 1; stg[(stg[  32        i--)
  32        CONNFIG_113_driver_desc" clned                                      4)ss="0" "L32">  32          10#include "  45        if (!  29
  29
i--)
  29
  12

  29
  22static inline 1void 122_driver_desc" clned         bclude/asm-alpak2="c.c#L16" id="L16" class="line" nameaf="+ess = 0;
  32         = 0;
(blocks_in_map;
  12
i;
 = 0;
(  12
  29
i =   29
stg[class="line" na *" name="L44">  44          29

  37        int mac_par1titio13f_driver_descbclude/asm-alpak2="href="block/partitions/mac.c#L39" id="L39" class="line" n"L37">  37        int dev_t dev"sref">sect);
, int , int   32        Sector1   12
da1a;name="L17">  17
slot1,   17
1secsi1e;
state,iut_codeass="s="+code=sect" class="id="L45" class="line" name="L45">  45        if (!CO1NFIG_136="+code=sect" class="sref">tiolca="L45" class="liniolca=="+code=sect" class="sref">sect);
state,ip_buf="blocsref">i--)
state,PAGE_SIZEname="L45">  45        if (!fo1und_r1ot = 0;
  29

The original LXR software by /mac29">  29LXR y. *unity="bloc   29lxr@llasx.no="bl.
ne" id=59/88ac.c#L4subf" cer">
lxr.llasx.no kindly hosc.c#by 29">  29Redpill clapro AS="blocprovider of clasx y.ns">